help required in datagrid dynamic template column
hi peter and all,
as i was going through all the posting regarding datagrid, u were the person to reply them....
so pls help me to solve my issue tooo.....
i am creating dymamic textbox in a datagrid, and trying to retrive the value for the same on postback, but at the time of adding the control i am gettign the Contols.Count as some value, but after postback i am not able to find any control in that cell....
Code Strip :::
/// at the time of adding the control
TextBox txtNewCtrl = new TextBox();
txtNewCtrl.EnableViewState = true;
e.Item.Cells[0].Controls.Add(txtNewCtrl);
/// at the time of getting the control value
TextBox tb = (TextBox) QGrid.Items[j].Cells[0].Controls[1];
if(tb.Text!="")
a_result = tb.Text;
//////
but at this time i am getting null exception since its not getting any control in that same cell
pls help me
regards
Govind
|