472,965 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,965 software developers and data experts.

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

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
Nov 20 '05 #1
1 3026
Check out the DataGridColumnStyles object

Regards

"BuzzLight" <Bu*******@Domain.com> wrote in message
news:8D****************@news-binary.blueyonder.co.uk...
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

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jon | last post by:
Hello, I have a datagrid and the data in it is dynamically created at runtime... For iCounter = 0 To dataset.Tables(0).Columns.Count - 1 Dim objbc As New BoundColumn() With objbc .DataField...
3
by: Kevin | last post by:
Hi Al I want to add two combobox columns in my datagrid. the one combobox column must be bound to the same datasource that the datagrid is, and the other combobox I just want to populate with a...
3
by: rawCoder | last post by:
Hi There, I simply want a DataGrid in .NET which acts .. well like the old VB6 grid .... where you fill and access elements directly ... not being dependant on some data source or DataSet to be...
2
by: Bob Trabucco | last post by:
Hello all, I have a Datagrid on a page. 1 column is a template column with a checkbox (unbound). The rest of the columns are databound that are added programatically. If in the Page_Load I...
1
by: Bob Trabucco | last post by:
Hello all, I have a Datagrid on a page. 1 column is a template column with a checkbox (unbound). The rest of the columns are databound that are added programatically. Grid Definition... ...
15
by: John Blair | last post by:
Hi, Code attached but the line that gives me an error is MyDataGrid.Columns(2).Visible = False It actually gives me an error for any value instead of 2 even when 9 bound columns of data exist....
1
by: Ken Varn | last post by:
I have a problem where my DataGrid would not maintain the ViewState of my databound rows. I finally narrowed down the problem. If my first column is a template column, the view state for the...
7
by: Juan Romero | last post by:
Hey guys, please HELP I am going nuts with the datagrid control. I cannot get the damn control to refresh. I am using soap to get information from a web service. I have an XML writer output...
3
by: TPhelps | last post by:
I have a sample of an unbound (autogeneratecolumns is true) sortable/pagable datagrid that works. I want to change one of the columns to a hyperlink. The examples I find use a bound column. I...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.