MMIMadness
Technical User
I have a datagrid returning a set of values and I want to change the CSS value of a cell based on the value of another value returned in the query. The only way I’ve managed to do it so far is to include the reference value as a column displayed on the final data grid and use the following code to change the values:
But I don’t want the viewer to see the referance value.
If anyone has any ideas on how this couls be done or can point me in the direction of some examples I would be most gratful.
Many thanks,
MMIMadness
Code:
Protected Sub GridView2_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView2.RowDataBound
If e.Row.RowType = DataControlRowType.DataRow Then
If e.Row.Cells(6).Text = "1" Then
e.Row.Cells(1).CssClass = "up"
else
e.Row.Cells(1).CssClass = "down"
End If
End If
End Sub
If anyone has any ideas on how this couls be done or can point me in the direction of some examples I would be most gratful.
Many thanks,
MMIMadness