Datagrid columnheaders

  • Thread starter Thread starter EMW
  • Start date Start date
E

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
 
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
 
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.
 
Back
Top