How can i access Templated columns of datagrid in code behind
-
Hi all, I have a problem with my datagrid. i have created three template columns in my datagrid but i cant access the column contents in code behind. I used Allot_Grid.SelectedItem.Cells[1].Text to access the first col of the grid but it returns null. Help!!!
-
Hi all, I have a problem with my datagrid. i have created three template columns in my datagrid but i cant access the column contents in code behind. I used Allot_Grid.SelectedItem.Cells[1].Text to access the first col of the grid but it returns null. Help!!!
Hi use
Allot_Grid.SelectedItem.FindControl("controlId")
you must be using some control inside your TemplateColumn. The above code will give you the reference to the control as an object. You have to typecast it to the control and then use can use the properties of the control. Thanks,Pradipta Basu