I've got 3 grids on a page and on the load of the page I can highlight the first row of each grid using the following code. I'll mention here that the Leave and Cost grid both relate to the ID of the Employees grid.
'select the first row in every page if no row selected
Protected Sub radgridEmployees_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles radgridEmployees.PreRender
If radgridEmployees.SelectedIndexes.Count = 0 Then
If radgridEmployees.Items.Count > 0 Then
radgridEmployees.SelectedIndexes.Add(0)
radgridEmployee_Costs.DataBind()
If radgridEmployee_Costs.Items.Count > 0 Then
radgridEmployee_Costs.SelectedIndexes.Add(0)
End If
radgridEmployee_Leave.DataBind()
If radgridEmployee_Leave.Items.Count > 0 Then
radgridEmployee_Leave.SelectedIndexes.Add(0)
End If
End If
End If
End Sub
I can however get the 1st row of the Leave and Costs grids to highlight when I click on a different row in the Employees grid.
What am I missing? I've tried to use the above code (without the DataBind's) in a number of events but cant seem to get it to work. Enable Client Side Row Selection is enabled for all the grids.
Thanks
Richard