S
saha
Group,
This is the problem I am facing (VS2005):
- I do a GridView1.DataSource = DataTable and GridView1.DataBind()
- then I add checkbox coltrols to a selected few cells of the GridView:
CheckBox cb = new checkBox();
cb.ID = "cbSelect";
GridView1.Rows[j].Cells[k].Controls.Add(cb);
Every thing works fine and I am able to see the checkboxes on screen.
The user is suppose to select the checkbox, which ever is applicable
and is suppose to click a button for further processing.
On click of the button, I try to fetch the checkBoxes by doing
FindControl on the appropriate cells:
CheckBox cb =
(CheckBox)GridView1.Rows[j].Cells[k].FindControl("cbSelect");
But I always get cb as null. Any idea what might be wrong here ?
Yes, on button click, I check for the controls *before* reassigning the
datasource again.
saha
--
This is the problem I am facing (VS2005):
- I do a GridView1.DataSource = DataTable and GridView1.DataBind()
- then I add checkbox coltrols to a selected few cells of the GridView:
CheckBox cb = new checkBox();
cb.ID = "cbSelect";
GridView1.Rows[j].Cells[k].Controls.Add(cb);
Every thing works fine and I am able to see the checkboxes on screen.
The user is suppose to select the checkbox, which ever is applicable
and is suppose to click a button for further processing.
On click of the button, I try to fetch the checkBoxes by doing
FindControl on the appropriate cells:
CheckBox cb =
(CheckBox)GridView1.Rows[j].Cells[k].FindControl("cbSelect");
But I always get cb as null. Any idea what might be wrong here ?
Yes, on button click, I check for the controls *before* reassigning the
datasource again.
saha
--