I have a gridview in my web page. I have boundcolumn,checkboxcolumn and a linkbutton column.
The commandName of the linkbutton column is "Select"
The name of the template checkbox is "chkSwapSelect".
I want to check the checkbox of the linkbutton clicked row.
When i click the linkbutton of the gridview RowCommand Event fires
RowCommand Event Code:
Expand|Select|Wrap|Line Numbers
- if e.commandName="Select" then
- Dim index as integer=Integer.Parse(e.CommandArgument)
- Dim row as GridVIewRow=dgvAllocation.rows(index)
- dim chk as checkbox
- chk=new checkbox
- chk=ctype(row.FindControl("chkSwapSelect"),checkbox) // chk returns nothing
- chk.checked=true // object reference not set to an instance of the object
- end if
Please help me in finding the controls inside a gridview via RowCommand Event