473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 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 3045
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.