I want to select a row on clicking anywhere on the row in grid view.
So i can capture the index of the Gridview.
I have used in Gridview RowDataBound
If (e.Row.RowType = DataControlRowType.DataRow) Then
e.Row.Attributes.Add("onmouseover", "this.style.cursor='hand';this.style.textDecoration='underline';")
e.Row.Attributes.Add("onmouseout", "this.style.textDecoration='none';")
e.Row.Attributes.Add("onclick", ClientScript.GetPostBackClientHyperlink(Me.gvDrugs, "Select$" + e.Row.RowIndex.ToString()))
Dim str As String
str = e.Row.RowIndex.ToString()
while loading there is no problem..
When the Gridview is appeared and i click on the GridView row it throws exception
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
So i added In page Directive
AutoEventWireup="false"
EnableEventValidation="false"
But still getting the same error.
I want to capture the (id that comes from the database) on the click of the row in the grid
Can any one help me.
Thank you,
yashoda
[edit]Code blocks adde, some minor tweaks - OriginalGriff[/edit]