Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have the following code in two different pages; both in a gridview_RowDataBound

If e.Row.RowType = DataControlRowType.DataRow Then
            If (e.Row.RowState And DataControlRowState.Edit) <> 0 OrElse (e.Row.RowState And DataControlRowState.Insert) <> 0 Then
                Dim btnSauvegarder As ImageButton = CType(e.Row.Cells(0).Controls(0), ImageButton)
                If btnSauvegarder.CommandName = "Update" Then
                    btnSauvegarder.OnClientClick = String.Format("if (!valideLeTout(" & e.Row.RowIndex & ")) return false;")
                End If
            End If
End If

When I click on the 'Modify' button at the beginning of the first row in one of the gridview, the e.Row.RowIndex returns 1 and in the other gridview it returns 0. Same with editIndex; one returns 1 and the othe returns 0.

Both of my gridviews have a header. I have compared the properties of both gridviews and they are the same.

Can anybody explain to me what's going wrong ?
Posted
Updated 11-Feb-11 5:35am
v4
Comments
Sandeep Mewara 10-Feb-11 0:50am    
Share the designer HTML of both the grids.
Shahriar Iqbal Chowdhury/Galib 10-Feb-11 2:51am    
share the full code with markup (.aspx page codes), then its possible to diagnosis the issue.
wizardzz 10-Feb-11 16:50pm    
Richard, I am aware she is the OP. I meant original post, not poster per say.
marie3 11-Feb-11 11:30am    
Ok, but as you can see, there is no room here to post all the code.

As anyone seen this behavior in the rowDataBound event of a gridView ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900