I have a radgrid which is populated via my vb code below:
Dim Get_Service_Reports As String = "Select * from Service_Reports "
Get_Service_Reports_Adapter = New SqlDataAdapter(Get_Service_Reports, DBConn)
Service_Reports_Table = New DataTable
Get_Service_Reports_Adapter.Fill(Service_Reports_Table)
If Not IsPostBack Then
RadGrid1.DataSource = Service_Reports_Table End If
RadGrid1.DataBind()
That code executes in the page load.
I then add the following code to give colors to rows depending on certain values
Dim Get_Service_Reports As String = "Select * from Service_Reports "
Get_Service_Reports_Adapter = New SqlDataAdapter(Get_Service_Reports, DBConn)
Service_Reports_Table = New DataTable
Get_Service_Reports_Adapter.Fill(Service_Reports_Table)
If Not IsPostBack Then
RadGrid1.DataSource = Service_Reports_Table End If
RadGrid1.DataBind()
That code executes in the page load.
I then add the following code to give colors to rows depending on certain values
For
i As Integer = 0 To RadGrid1.Items.Count - 1
If Service_Reports_Table(i)("Status") = "Newly Submitted" Then
RadGrid1.Items.Item(i).BackColor = Drawing.Color.Wheat
ElseIf Service_Reports_Table(i)("Status") = "Entered" Then
RadGrid1.Items.Item(i).BackColor = Drawing.Color.Thistle
End If
Next
That code right above appears in both the page load and the needdatasource events.
When a user applies a filter or clicks on the edit, update, cancel commands, the colors disappear until a postback occurs.
Can something be done so that the "Code for the colors" execute when those commands are fired?