P
p3t3r
In .NET 1.x it was possible to add an onclick callback to invoke the
selection of a row in the grid providing there was a Select command.
This still works in .NET 2.0 but now the cell with the Select command must
be visible. The users are accustomed to being able to select without seeing
an extra column.
If the Select command is not visible the page raise an error as the event is
invalid. How can I keep the Select command invisible and yet still use the
event?
Here's the code (VB) to put in the RowDataBound event for the grid
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand';
this.style.backgroundColor='lightpink';")
e.Row.Attributes.Add("onmouseout",
"this.style.backgroundColor='';")
e.Row.Attributes.Add("onclick",
Page.ClientScript.GetPostBackEventReference(sender, "Select$" +
e.Row.RowIndex.ToString))
End If
selection of a row in the grid providing there was a Select command.
This still works in .NET 2.0 but now the cell with the Select command must
be visible. The users are accustomed to being able to select without seeing
an extra column.
If the Select command is not visible the page raise an error as the event is
invalid. How can I keep the Select command invisible and yet still use the
event?
Here's the code (VB) to put in the RowDataBound event for the grid
If e.Row.RowType = DataControlRowType.DataRow Then
e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand';
this.style.backgroundColor='lightpink';")
e.Row.Attributes.Add("onmouseout",
"this.style.backgroundColor='';")
e.Row.Attributes.Add("onclick",
Page.ClientScript.GetPostBackEventReference(sender, "Select$" +
e.Row.RowIndex.ToString))
End If