Binding an ArrayList to a datagrid

D

Doug

Hi,

I am having the same problem I had a while back with a windows app but
now in a web application. I need to take the results of a data query
and dump them into an arraylist. I then need to bind that array list
into a datagrid in my web app. It works fine, but the columns are out
of order.

I solved this in my windows application by using
DataGridTextBoxColumns. However, I cannot find an equivalent in my web
application. I tried to create a Bound Column to solve this issue, but
it caused another one - in the sense that it caused two columns for
every one column I needed.

How is this typically done?
 
B

Brennan Stehling

Doug,

If you are using DataGrid I assume that means you are using ASP.NET
1.1. In ASP.NET 2.0 the GridView control replaces the DataGrid and
provides some helpful support to organize your data columns.

See here...

http://www.asp.net/learn/dataaccess/tutorial12vb.aspx?tabid=63

In your case, it sounds like you are automatically having the columns
generated. You can turn that off in the Properties panel and add the
columns in the order you like.

Brennan Stehling
http://brennan.offwhite.net/blog/
 
D

Doug

In your case, it sounds like you are automatically having the columns
generated. You can turn that off in the Properties panel and add the
columns in the order you like.

So I'd have to do it in code? There's no way to do it dynamically?
 
D

Doug

or boundcolums with autogenerate false set as Brennen suggested, and that can be set as a property of the >datagrid declaration.

Thanks! I misunderstood what Brennen was suggesting, but I figured it
out now and it's working great! Thank you!
 

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,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top