473,396 Members | 1,927 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,396 software developers and data experts.

Datagrid columnheaders

EMW
Hi,

On my quest to learn more about VB.NET I'm again stuck with some
questions....

I've got a filled datagrid (filled from an Excel file) and the column
headers have the same name as in the Excel file.
The data is also in a dataset.

In some programs (windows explorer, for instance) it is possible to
re-arrange the column order.
I.e. I want columns A, B and C to be like B, A, C.

I need to know if it is possible with the datagrid (microsofts help doesn't
mention it, or I haven't seen it) to do so and if yes, is it possible to do
it with the mouse with a kind of drag and drop?

I also need to know if it is possible to change the column labels to some
other text?

Thanks!!
Eric
Nov 20 '05 #1
5 1710
Hi,

You need to add a tablestyle to your grid.
http://msdn.microsoft.com/library/de...stdatagrid.asp

Ken
----------------------
"EMW" <so*****@microsoft.com> wrote in message news:3fb69e66$0$79344
$5******@dreader2.news.tiscali.nl...
Hi,

On my quest to learn more about VB.NET I'm again stuck with some
questions....

I've got a filled datagrid (filled from an Excel file) and the column
headers have the same name as in the Excel file.
The data is also in a dataset.

In some programs (windows explorer, for instance) it is possible to
re-arrange the column order.
I.e. I want columns A, B and C to be like B, A, C.

I need to know if it is possible with the datagrid (microsofts help doesn't mention it, or I haven't seen it) to do so and if yes, is it possible to do it with the mouse with a kind of drag and drop?

I also need to know if it is possible to change the column labels to some
other text?

Thanks!!
Eric

Nov 20 '05 #2
EMW
Thanks!!
"Ken Tucker [MVP]" <vb***@bellsouth.net> schreef in bericht
news:ex******************@TK2MSFTNGP11.phx.gbl...
Hi,

You need to add a tablestyle to your grid.
http://msdn.microsoft.com/library/de...stdatagrid.asp
Ken
----------------------
"EMW" <so*****@microsoft.com> wrote in message news:3fb69e66$0$79344
$5******@dreader2.news.tiscali.nl...
Hi,

On my quest to learn more about VB.NET I'm again stuck with some
questions....

I've got a filled datagrid (filled from an Excel file) and the column
headers have the same name as in the Excel file.
The data is also in a dataset.

In some programs (windows explorer, for instance) it is possible to
re-arrange the column order.
I.e. I want columns A, B and C to be like B, A, C.

I need to know if it is possible with the datagrid (microsofts help

doesn't
mention it, or I haven't seen it) to do so and if yes, is it possible to

do
it with the mouse with a kind of drag and drop?

I also need to know if it is possible to change the column labels to some other text?

Thanks!!
Eric


Nov 20 '05 #3
EMW
Hi,

I managed to create my own column headers.

I'll take it is not possible to re-arrange the columns with the mouse and
that the data moves along with it?

Also I would like to know if it is a bug or not: When I set the MAPPINGNAME
to something with a dot in it: i.e. "test. Net"
It isn't excepted and the column is not shown.

The table I read into the datagrid has one column name with a dot in it, so
that is how I found this problem.

rg,
Eric
"Ken Tucker [MVP]" <vb***@bellsouth.net> schreef in bericht
news:ex******************@TK2MSFTNGP11.phx.gbl...
Hi,

You need to add a tablestyle to your grid.
http://msdn.microsoft.com/library/de...stdatagrid.asp
Ken
----------------------
"EMW" <so*****@microsoft.com> wrote in message news:3fb69e66$0$79344
$5******@dreader2.news.tiscali.nl...
Hi,

On my quest to learn more about VB.NET I'm again stuck with some
questions....

I've got a filled datagrid (filled from an Excel file) and the column
headers have the same name as in the Excel file.
The data is also in a dataset.

In some programs (windows explorer, for instance) it is possible to
re-arrange the column order.
I.e. I want columns A, B and C to be like B, A, C.

I need to know if it is possible with the datagrid (microsofts help

doesn't
mention it, or I haven't seen it) to do so and if yes, is it possible to

do
it with the mouse with a kind of drag and drop?

I also need to know if it is possible to change the column labels to some other text?

Thanks!!
Eric


Nov 20 '05 #4
Good question. Let me take a shot at it.

Rearrange the column order - use a dataview instead with the order you want.

Is it possible to rearrange like in windows explorer - if datagrid doesn't
let you, write your own control to do it, shouldn't be that hard and we
might steal it from you.

Can you change the column labels to other text - yes - explore
"tablemappings" and "ColumnMappings" in MSDN.

- Sahil Malik
Independent consultant.

"EMW" <so*****@microsoft.com> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
Hi,

On my quest to learn more about VB.NET I'm again stuck with some
questions....

I've got a filled datagrid (filled from an Excel file) and the column
headers have the same name as in the Excel file.
The data is also in a dataset.

In some programs (windows explorer, for instance) it is possible to
re-arrange the column order.
I.e. I want columns A, B and C to be like B, A, C.

I need to know if it is possible with the datagrid (microsofts help doesn't mention it, or I haven't seen it) to do so and if yes, is it possible to do it with the mouse with a kind of drag and drop?

I also need to know if it is possible to change the column labels to some
other text?

Thanks!!
Eric

Nov 20 '05 #5
Good question. Let me take a shot at it.

Rearrange the column order - use a dataview instead with the order you want.

Is it possible to rearrange like in windows explorer - if datagrid doesn't
let you, write your own control to do it, shouldn't be that hard and we
might steal it from you.

Can you change the column labels to other text - yes - explore
"tablemappings" and "ColumnMappings" in MSDN.

- Sahil Malik
Independent consultant.

"EMW" <so*****@microsoft.com> wrote in message
news:3f**********************@dreader2.news.tiscal i.nl...
Hi,

On my quest to learn more about VB.NET I'm again stuck with some
questions....

I've got a filled datagrid (filled from an Excel file) and the column
headers have the same name as in the Excel file.
The data is also in a dataset.

In some programs (windows explorer, for instance) it is possible to
re-arrange the column order.
I.e. I want columns A, B and C to be like B, A, C.

I need to know if it is possible with the datagrid (microsofts help doesn't mention it, or I haven't seen it) to do so and if yes, is it possible to do it with the mouse with a kind of drag and drop?

I also need to know if it is possible to change the column labels to some
other text?

Thanks!!
Eric

Nov 20 '05 #6

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

Similar topics

0
by: DraguVaso | last post by:
Hi, I want to customize my DataGrid (for VB.NET) a little bit by adding an image to my columnHeaders etc. I need to override the Paint-event of it, but the problem is: I don't know from which...
0
by: Adam | last post by:
Hi How I can control Column Headers in the Microsoft ListView by VBA I can add Private Sub ListView_Click() Dim lv As MSComCtlLib.ListView Set lv = Me.ListView.Object With lv '.ColumnHeaders =...
0
by: sunil | last post by:
Is there a way i can enable rowheaders and columnheaders(which are like button) on a datagrid control. Appreciate any help. Thanks
1
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls...
2
by: Martin Wolff | last post by:
Hi everybody, in my datagrid I want to show the text in the columnheaders working as a linklabel. It is already working, doing different things depending on the colheader, which has been...
0
by: EMW | last post by:
Hi, On my quest to learn more about VB.NET I'm again stuck with some questions.... I've got a filled datagrid (filled from an Excel file) and the column headers have the same name as in the...
1
by: Jabco | last post by:
I need a grid that displays hierachical related tables. The grid's DataSource is a dataset. Maybe there is a better way I don't know. There are 2 tables in the dataset. They have a Relations on...
1
by: simchajoy2000 | last post by:
Is it possible to allow users to edit datagrid columnheader names during run-time? And it is possible to create "header names" for rows in a datagrid as well? Thanks!! Joy
1
by: Familjen Karlsson | last post by:
Hi I want to add columns in a Datagrid and I want the Columnheaders to show and empty cells to show without adding any records. For example, sometimes there aren 't any records in the database,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.