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

R

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
 
E

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top