Datagrid columnheaders  
Author Message
w2k3reboot





PostPosted: Sat Nov 15 21:10:35 CST 2003 Top

Visual Basic [VB] >> Datagrid columnheaders

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

Visual Studio174  
 
 
Ken





PostPosted: Sat Nov 15 21:10:35 CST 2003 Top

Visual Basic [VB] >> Datagrid columnheaders Hi,

You need to add a tablestyle to your grid.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/wnf_custdatagrid.asp

Ken
----------------------


> 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
>
>


 
 
EMW





PostPosted: Sun Nov 16 09:55:36 CST 2003 Top

Visual Basic [VB] >> Datagrid columnheaders Thanks!!




> Hi,
>
> You need to add a tablestyle to your grid.
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/wnf_custdatagrid.asp
>
> Ken
> ----------------------


> > 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
> >
> >
>
>


 
 
EMW





PostPosted: Sun Nov 16 13:27:25 CST 2003 Top

Visual Basic [VB] >> Datagrid columnheaders 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




> Hi,
>
> You need to add a tablestyle to your grid.
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/wnf_custdatagrid.asp
>
> Ken
> ----------------------


> > 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
> >
> >
>
>


 
 
Sahil





PostPosted: Sun Nov 23 02:12:31 CST 2003 Top

Visual Basic [VB] >> Datagrid columnheaders 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.





> 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
>
>