M
masoud bayan
I wanted to add template columns to a datagrid at run time to show some text
boxes on grid.
As I do not know how many columns I have at design time I must create these
columns dynamically. I did it by inheriting a class from ITemplate interface
and assigning it to itemtemplate property of datagrid columns. Everything
seems fine and now I have a datagrid with variable columns and each cell is
a text box, but the problem is after post back I loose these columns and can
not read entered values in textboxes? after postback number of datagrid
columns is same as number design time columns so I loose add columns and
their values.
Is there any way that I can have access to these columns and textboxes?
boxes on grid.
As I do not know how many columns I have at design time I must create these
columns dynamically. I did it by inheriting a class from ITemplate interface
and assigning it to itemtemplate property of datagrid columns. Everything
seems fine and now I have a datagrid with variable columns and each cell is
a text box, but the problem is after post back I loose these columns and can
not read entered values in textboxes? after postback number of datagrid
columns is same as number design time columns so I loose add columns and
their values.
Is there any way that I can have access to these columns and textboxes?