I have a datagrid in ASP.NET using VB.NET code which, when loaded it takes a parameter from the URL called DexNumb. When this parameter is brought it, it highlights the entire row Red and makes it bold but if the datagrid is long and some elements can only be viewed by scrolling down, it will not go straight to the elements, the user must scroll down in order to view them. Here is the method that is launched from the datagrid on Page_Load:
Code: ( text )
Protected Sub PopulateIPC_OnItemDataBound(ByVal sender as System.Object, ByVal e As DataGridItemEventArgs) Handles PopulateIPC.ItemDataBound
Dim JScrpt As String
If e.Item.Cells(0).Text = DexNumb Then
e.Item.BackColor = System.Drawing.Color.Red
e.Item.Font.Bold=True
JScrpt = "<script language=JavaScript>"
JScrpt += "e.Item.Cells.focus();"
JScrpt += "<"
JScrpt += "/script>"
Page.RegisterStartupScript("Popup", JScrpt)
End If
End Sub
The Javascript is contained in the method but it works the same way with or without it. Any thoughts on a quick fix for this? TIA
Code: ( text )
Protected Sub PopulateIPC_OnItemDataBound(ByVal sender as System.Object, ByVal e As DataGridItemEventArgs) Handles PopulateIPC.ItemDataBound
Dim JScrpt As String
If e.Item.Cells(0).Text = DexNumb Then
e.Item.BackColor = System.Drawing.Color.Red
e.Item.Font.Bold=True
JScrpt = "<script language=JavaScript>"
JScrpt += "e.Item.Cells.focus();"
JScrpt += "<"
JScrpt += "/script>"
Page.RegisterStartupScript("Popup", JScrpt)
End If
End Sub
The Javascript is contained in the method but it works the same way with or without it. Any thoughts on a quick fix for this? TIA