Adding Columns at runtime in datagrid control

N

Naveed Alam

have a datgrid control that has 3 columns defined at design time.
Remaining columns are coming from a query and not known until runtime. I
have dynamically added the columns in datagrid and constructed an array
that holds results to be displayed in the corresponding cells of newly
added columns. I don't know how to assign these array members to
corresponding cells of these columns.
I am using datarow's itemarray property to assign the array members to
each corresponding cell. but getting an error stating "Input array is
longer than the number of columns in this table". Please tell me the
exact way of doing my task. Any help please???
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top