Dynamic Columns

A

Amr Moselhy

Hi Everyone
i have problem that columns created dynamically in the run time using bining
cannot be accessed later on.
now i bind a datagrid to a datasource e.g
datagrid.datasource = datatable
datagrid.DataBind();
so the data are loaded into the datagrid correctly

when i try to read the access the columns using
datagrid.Columns[1].HeaderText = "AAA";
i get an error
that datagrid.Columns.Count = 0;

how can i access the columns that created in the run time ????
plz advice
 
E

Eliyahu Goldin

Autogenerated columns don't get into Column collection. You can catch them
only in ItemCreated event handler.

Eliyahu
 

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

No members online now.

Forum statistics

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

Latest Threads

Top