G
Guest
A)I build a datagrid based on a calendar date selection.
B)When user clicks a button column on the datagrid I want to highlight this
row. I use the code below to highlight the row.
***** CODE TO HIGHLIGHT ROW
Sub Datagrid_ItemCommand(ByVal s As Object, ByVal e As
DataGridCommandEventArgs)
If e.CommandName = "ViewUnitRequest" Then
e.Item.BackColor = System.Drawing.Color.LightGray
end if
End Sub
*****
C)This works and the row clicked is highlighted.
D)Problem is if user clicks a different row, the old row stays highlighted
and the new row is highlighted.
E)How do I make sure the old row is back to normal color?
F)Do I need to rebind the datagrid before i change the color?
Thank you
B)When user clicks a button column on the datagrid I want to highlight this
row. I use the code below to highlight the row.
***** CODE TO HIGHLIGHT ROW
Sub Datagrid_ItemCommand(ByVal s As Object, ByVal e As
DataGridCommandEventArgs)
If e.CommandName = "ViewUnitRequest" Then
e.Item.BackColor = System.Drawing.Color.LightGray
end if
End Sub
*****
C)This works and the row clicked is highlighted.
D)Problem is if user clicks a different row, the old row stays highlighted
and the new row is highlighted.
E)How do I make sure the old row is back to normal color?
F)Do I need to rebind the datagrid before i change the color?
Thank you