gary
|
Posted: 08/23/2004, 10:30 AM |
|
Has anyone figured out how to conditionally color a row?
Prior to ASP.NET I did this via the BeforeShowRow event...
' -------------------------
if (CCParseInteger( CCGetParam("CategoryID", Empty), "" ) = tblServiceCateg.Recordset.Fields("CategoryID")) then
tblServiceCateg.TemplateBlock.Block("Row").Variable("color") = "#E4E4E4" ' select color (med grey)
else
tblServiceCateg.TemplateBlock.Block("Row").Variable("color") = "WhiteSmoke" ' default color (lt grey)
end if
' -------------------------
but I can't figure out the equivalent in .NET. Any help is much appreciated...
gary
|
|
|
E43509
Posts: 283
|
Posted: 08/23/2004, 11:13 AM |
|
I'm not by my machine to give you code one approach to take is to add a runat=server to the table so you can now programmatically call get at HTMLTable Control.
|
|
|
gary
|
Posted: 08/23/2004, 1:27 PM |
|
Much thanks for the reply....any chance fo getting a code snippit once you get back to your machine? When it comes to .NET, it gives a whole new meaning to the phrase "devil in the details"...
gary
|
|
|
Shawn Mason
|
Posted: 08/24/2004, 7:23 PM |
|
in your HTML
<td id="CreditorAlt" runat="server" class="FoggyDayAltDataTD">
then you can refer to the <td> element (or you can do this for a <tr> or any
other html control) in code.
HTH,
Shawn Mason
"gary" <gary@forum.codecharge> wrote in message
news:8412a29a249868@news.codecharge.com...
> Has anyone figured out how to conditionally color a row?
>
> Prior to ASP.NET I did this via the BeforeShowRow event...
>
> ' -------------------------
> if (CCParseInteger( CCGetParam("CategoryID", Empty), "" ) =
> tblServiceCateg.Recordset.Fields("CategoryID")) then
> tblServiceCateg.TemplateBlock.Block("Row").Variable("color") = "#E4E4E4" '
> select color (med grey)
> else
> tblServiceCateg.TemplateBlock.Block("Row").Variable("color") =
"WhiteSmoke" '
> default color (lt grey)
> end if
> ' -------------------------
>
> but I can't figure out the equivalent in .NET. Any help is much
> appreciated...
>
> gary
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
dataobjx
Posts: 181
|
Posted: 08/25/2004, 9:22 AM |
|
You can go to http://www.dataobjx.net, register and download the first issue of CCS Developer Magazine and source code for the articles for FREE.
The article on Dynamically Formatting Row Colors demonstrates a technique for achieving this.
_________________
www.DataObjx.net
www.mydigitalapps.com |
|
|