Datagrid - Manually add stuff
Hi,
Not sure if a datagrid is what i should use. Can one manually (in code) add rows and colums as you wish? (No datasource used)
I need a control to which i can add rows and columns manually...something like code will go like: (This is just "play-code" to try illustrate what I mean)
Dim ColItems As Collection
Dim RowItems as Collection
Dim ColItem as Item
Dim RowItem as Item
For Each ColItem in ColItems
Control.Columns.Add(ColItem.Name)
Next ColItem
For Each RowItem in RowItems
Control.Rows.Add(RowItem.Name)
Next RowItem
Re: Datagrid - Manually add stuff
yes... what you would do is make a datatable.. and fill the datatable with data manually.... then you create a dataview from your datatable... and the dataview can be set to the datasource of the grid... confused yet??? :bigyello:
take a look at this... it is ASP.NET... but the code for the actual filling of the datagrid is exactly what you are looking to do...
http://www.dotnetjunkies.com/quickst.../DataBind4.src