View Single Post
  #16  
Old 08-03-2007, 05:13 AM
garunprasad garunprasad is offline
D-Web Trainee
 
Join Date: Mar 2007
Location: Chennai
Posts: 45
garunprasad is on a distinguished road
Send a message via ICQ to garunprasad Send a message via AIM to garunprasad Send a message via MSN to garunprasad Send a message via Yahoo to garunprasad Send a message via Skype™ to garunprasad
Default Re: Implementation Data Controls in asp.net

Hi guys
Thanks for the replies. I managed to add a check box using an approach similar to the one suggested by JSuresh, but involved creating a class extending INamingContainer, ITemplate.
Found this link really helpful: WEBSWAPP Development Inc.
However, I'm having trouble getting to this control by using GridViewRow's FindControl method. For some reason, it does not locate the control in the row with the ID that has been allocated to the checkbox.
Here is my code:
//--
foreach (GridViewRow gvr in GridView1.Rows)
{
CheckBox chkSelect = (CheckBox)gvr.FindControl("chkUpdate");
if (chkSelect != null && chkSelect.Checked)
{
gvr.Cells[5].Text = ddlChangeStatus.SelectedValue;
DataRow dr = ds.Tables[0].Rows[gvr.DataItemIndex];
dr["Status"] = ddlChangeStatus.SelectedValue;
}
}
//--
It returns a null for that particular control. Any suggestions??
Thanks
__________________
G.A.P
Reply With Quote