Expandable columns in DataGridView

Hi,

I have to create a customized datagridview to enable the expandable columns. If anyone already worked out this, please help me on this.

Thanks in advance,

Natraj




Answer this question

Expandable columns in DataGridView

  • JohnSLG

    What do you mean by expandable columns ones that the user can resize if that is what you are looking for. in the designer add a DataGridView to you form and AllowUserToResizeColumns is true by default.

  • George2

    Be aware that a DataGridView does not show relations unlike the DataGrid control...

    If you decide to use a DGV you could play with the Visible property of the DGVColumns... which results in a hide/show effect...

    A proof of concept at: http://www.timvw.be/hide-and-unhide-columns-or-rows-in-the-datagridview/


  • Beetle54

    Thanks for your reply !

    Expandable column in the sense drilling down the columns....

    One column can hide multiple columns. The user can see the child columns by clicking the + button before the column name

    Something like this..

    Stage 1 : (Before clicking the + button )

    Products + Categories Release Date

    Product1 ... 11/07/2006

    Stage 2 : After clicking the + button

    Products - Categories Release Date

    Category 1 Category 2 Category 3

    Product1 1 2 3 11/07/2006

    Note : Bold letters are column names..Unbold letters are values

    Ouput should be something like this.

    Thanks,

    Natraj.



  • prasoot

    Guys, you can use a dataset designer (includen in VS) and create the xml squema for your dataset's tables, in there, you can define datarelations between the tables which will therefore make your datagrid show the expandable + signs when you bind that dataset to it.


  • Expandable columns in DataGridView