Hi all,
I have a UltraWebGrid on a page and I need to format one column's cell values.
Pseudo Code: If the cell valus is 0<value<100, set the cell's fontcolor to red, else set it to green.here is the code I have tried on the RowDataBound event:
{
UltraGridRow thisRow = UltraWebGrid1.Rows.FromKey("GetPercentageAchieved");
}
else
Also here is the code for the column in question:
<igtbl:UltraGridColumn BaseColumnName="GetPercentageAchieved" Key="GetPercentageAchieved"
IsBound="True" DataType="System.Decimal" Format="N2" Width="25%">
<Header Caption="% Achieved">
<RowLayoutColumnInfo OriginX="3" />
</Header>
<Footer>
</Footer>
</igtbl:UltraGridColumn>
The error I get is on the RowDataBound event which says that i'm getting a null reference.
Therefore, my question is, how do I get the cell value of each row of a particular column on RowDataBound?
Thanks in advance.
try
e.Row.Cells.FromKey("GetPercentageAchieved").Text
or
thanks
if you look closer at the code you will see that my question is about the RowDataBound event.
protected void UltraWebGrid1_DataBound(object sender, EventArgs e) { ....... }the list of properties available to me for the EventArgs is .GetHashCode(), .Equals(), . GetType(), .ToString()
So e.Row..... is not going to work here.
Thanks anyway.
allythacker said: if you look closer at the code you will see that my question is about the RowDataBound event. protected void UltraWebGrid1_DataBound(object sender, EventArgs e) { ....... }the list of properties available to me for the EventArgs is .GetHashCode(), .Equals(), . GetType(), .ToString() So e.Row..... is not going to work here.
protected
I don't know about C#, but in VB, the name "UltraWebGrid1_DataBound" usually handles the Grid.DataBound event, which fires after the entire grid is bound. And as far as I can see, there is no RowDataBound The Grid.InitializeRow fires once per row, and should give you access to one row at a time.
e.Row.Cells.FromKey("CELLID").Value
e.Row.Cells.FromKey("CELLID").Text