D
djc
one of the columns in my datagrid shows a date. I want to display dates <
the current date in red text. I believe I should be using the
OnDataItemBound event for this. Here is the problem I am having. When using
e.Item.Cells(4).Text I am getting the actual text displayed in the cell and
not the value from the database field. For example when this database field
is null the value of e.Item.Cells(4).Text ends up " ". This alone is ok
because I can count on it and test for it in my code. My issue gets a little
more sticky because the condition to display the text in red or not is 2
part. Condition to display text in red in pseudo code: (DateColumn < Today
AND StatusColumn = "In Progress"). The StatusColumn is a template column and
so its e.Item.Cells(5).Text winds up with <span> tags and may or may not
also show an <img> tag. So how do I handle this? I need to use the actual
database field values for my comparison... how do I get to them?
any info is greatly appreciated.
the current date in red text. I believe I should be using the
OnDataItemBound event for this. Here is the problem I am having. When using
e.Item.Cells(4).Text I am getting the actual text displayed in the cell and
not the value from the database field. For example when this database field
is null the value of e.Item.Cells(4).Text ends up " ". This alone is ok
because I can count on it and test for it in my code. My issue gets a little
more sticky because the condition to display the text in red or not is 2
part. Condition to display text in red in pseudo code: (DateColumn < Today
AND StatusColumn = "In Progress"). The StatusColumn is a template column and
so its e.Item.Cells(5).Text winds up with <span> tags and may or may not
also show an <img> tag. So how do I handle this? I need to use the actual
database field values for my comparison... how do I get to them?
any info is greatly appreciated.