FindControl not working in Gridview ItemTemplate of Button
-
The findcontrol event is not getting the control e.g. "btnSubmit" placed inside a gridview itemtemplate tag. please help with code in VB.NET
-
The findcontrol event is not getting the control e.g. "btnSubmit" placed inside a gridview itemtemplate tag. please help with code in VB.NET
test
-
The findcontrol event is not getting the control e.g. "btnSubmit" placed inside a gridview itemtemplate tag. please help with code in VB.NET
So, in event OnRowCommand(Code Behind) :
Protected Sub GridView_RowCommand(sender As [Object], e As GridViewCommandEventArgs)
Select Case e.CommandName
Case "Findx"
MethodFindControlValue()
Exit Select
End Select
End Sub..in MethodFindControlValue() :
Private Sub MethodFindControlValue()
For Each row As GridViewRow In ApprovalGrid.Rows
Dim chkItemSelect As CheckBox = CType(row.FindControl("chkItemSelect"), CheckBox)
Dim chkItemSelect As Label = CType(row.FindControl("lblname"), CheckBox)Dim id As String = Convert.ToString(NameGridView.DataKeys(row.RowIndex).Value.ToString()) Next
End Sub
hope this help you............:D
-
The findcontrol event is not getting the control e.g. "btnSubmit" placed inside a gridview itemtemplate tag. please help with code in VB.NET
paste the code what you have done till now?..so that we can help you in correcting the errors.
-
paste the code what you have done till now?..so that we can help you in correcting the errors.
Thanks for the help dear! but my case was solved as I used the LINK BUTTON instead of button in the itemtemplate tag of Gridview
-
Thanks for the help dear! but my case was solved as I used the LINK BUTTON instead of button in the itemtemplate tag of Gridview
ok...sure...enjoy coding...all the best..