### vb.net DataGrid problem, cant make unbound columns ###

  • Thread starter Thread starter BuzzLight
  • Start date Start date
B

BuzzLight

Iam very new to .net, in vb6 there was the flexigrid component, you could add rows, columns .. change their width, height, header captions etc very easily... but in .net all I see is one DataGrid.

I want to add columns and rows to it, change their header captions etc but it does not give me any options to add columns or rows!

I have found one way of adding columns :-

Dim table as new DataTable
table.columns.add("C1")
DataGrid.datasource = table

And that adds the column... but surely this is an unefficent way? there must be a better way of doing this.. I mean what if I wanted to add cols dynamically... this would mean I add them to the table then I had to call some sort of refresh on the datagrid, this makes the longwindedness seem more clear.

Anyone know a better way please share it.. i would be very greatful.

Thankyou
 
Check out the DataGridColumnStyles object

Regards

BuzzLight said:
Iam very new to .net, in vb6 there was the flexigrid component, you could
add rows, columns .. change their width, height, header captions etc very
easily... but in .net all I see is one DataGrid.
I want to add columns and rows to it, change their header captions etc but
it does not give me any options to add columns or rows!
I have found one way of adding columns :-

Dim table as new DataTable
table.columns.add("C1")
DataGrid.datasource = table

And that adds the column... but surely this is an unefficent way? there
must be a better way of doing this.. I mean what if I wanted to add cols
dynamically... this would mean I add them to the table then I had to call
some sort of refresh on the datagrid, this makes the longwindedness seem
more clear.
 
Back
Top