Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 29, 2007 12:09 AM by mhowell_hrx
Mar 20, 2006 06:18 PM|LINK
I want to add columns to a gridview control depending on the items in a config datatable in a for / next loop.
Can someone suggest the best way to do this? So far I have:
Dim row as dataset.itemsrow
Is this the correct or will this cause an error?
Mar 20, 2006 06:43 PM|LINK
Looks good to me, I code in C# and my code looks like
nameColumn = new
nameColumn.HeaderText = "row col name";
nameColumn.DataField = "row col field";
which looks like what you got in vb.net there, so go for it.... if you get an error, let me know, and we will help you through it.
Mar 20, 2006 06:44 PM|LINK
Also, have a look at this article I found, sampling how to create columns of different forms, such as template columns.
Mar 21, 2006 06:37 AM|LINK
Great, thanks. Will let you know how I get on
Mar 22, 2006 03:04 PM|LINK
Jul 29, 2007 12:09 AM|LINK
Just wanted to follow up, with something that took me some time to figure out:
For the DataGrid object, use the BoundColumn object and add it to the Columns collection
For the GridView object, use the BoundField object and add it to the Columns collection