Home All Groups Group Topic Archive Search About

How to set cell background based on cell value when datagrid is displayed

Author
17 Feb 2005 8:07 PM
RJ
I would like to check a datagrid cell value, and change the color of the
cell background, when a datagrid is displayed.  I want to do this as early
as possible after / during a page load event.  I tried looking into the
DataBinding event of the datagrid, but couldn't see how to get the
individual cells out of the EventArg passed into the DataBinding handler.  I
am hoping this can be done in a VB.net code-behind class and not require
editing of the HTML to accomplish this.  Thanks for any insights.

RJ

Author
17 Feb 2005 9:37 PM
Eliyahu Goldin
Second parameter passed to the event handler has type of
DataGridItemEventArgs. It has property Item which represents a datagrid row.
It has in turn property Cells which is what you are after.

Eliyahu

Show quoteHide quote
"RJ" <R*@PostOnly.com> wrote in message
news:u1G6VxSFFHA.3824@TK2MSFTNGP10.phx.gbl...
> I would like to check a datagrid cell value, and change the color of the
> cell background, when a datagrid is displayed.  I want to do this as early
> as possible after / during a page load event.  I tried looking into the
> DataBinding event of the datagrid, but couldn't see how to get the
> individual cells out of the EventArg passed into the DataBinding handler.
I
> am hoping this can be done in a VB.net code-behind class and not require
> editing of the HTML to accomplish this.  Thanks for any insights.
>
> RJ
>
>