I have given the id for checkbox also.
I get the checkbox column in gridview successfully.
Now i want to check all the checkbox in gridview.
But when i find checkbox controls in gridview with respect to the id i have given, it returns me nothing.
Following is the code in InstanceIn method of class GridViewTemplate which Implements Itemplate.
Expand|Select|Wrap|Line Numbers
- Select case ListItemType.Item
- Case ListItemType.Item
- Dim chk as checkbox
- chk=new checkbox
- chk.id="chkSelRoom"
- Container.items.add(chk)
- End Select
Expand|Select|Wrap|Line Numbers
- For each row as GridViewRow in dgvRoomDetails.rows
- dim ch as checkbox
- ch=new checkbox
- ch=CType(row.FindControl("chkSelRoom"),checkbox) // returns nothing
- ch.checked=true // object reference not set to an instance of the object
- End For