Dynamic columns and Cancel command

S

sos00

Hi guys,

i have created a user control which contains a datagrid and it's columns
will be create dynamically.
this grid is able to do Add,Edit and Delete.

because i create columns dynamically , i put columns generating code in
LoadViewState method of user control.

protected override void LoadViewState(object savedState)
{
base.LoadViewState (savedState);
Grd.DataSource = this.DataSource;
CreateColumns();
}

that's ok, but any control which cause postback will make trouble except
when it calls Grd.DataBind() method...
i try to call Grd.DataBind() method in LoadViewState() but when i do that,
Cancel and Update command buttons won't work...
what can i do ?


Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top