changing the color of a cell in a datagrid

F

Franck

hello,
I'm trying to change the color of certain cells
in a datagrid according to their values?

I tried to get the value in the Datagrid_ItemCreated event but I couldn't

I don't know where else to start?

any help?
thank you
 
G

Guest

what was wrong with the _ItemCreated call?
Also, look at the _ItemBound (or is it _ItemDataBound?) event.
 
N

Nishanthan

HI,
You cant do it in the Item created event. You should do it in the itembound
event.
Regards,
P.Nishanthan
 
S

Scott Mitchell [MVP]

Curt_C said:
what was wrong with the _ItemCreated call?
Also, look at the _ItemBound (or is it _ItemDataBound?) event.

In the ItemCreated event the data's not yet been bound to the
DataGridItem, so you can't reference the data. Hence you need to use
the ItemDataBound event, as you noted.
 
G

Guest

Depending on where the data is coming from though....

But yeah, you are right. The Bound is the better place.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com



Scott Mitchell said:
Curt_C said:
what was wrong with the _ItemCreated call?
Also, look at the _ItemBound (or is it _ItemDataBound?) event.

In the ItemCreated event the data's not yet been bound to the
DataGridItem, so you can't reference the data. Hence you need to use
the ItemDataBound event, as you noted.



--

Scott Mitchell [ASP.NET MVP]
(e-mail address removed)
http://www.4GuysFromRolla.com/ScottMitchell
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top