views:

37

answers:

1

Hi,

i have a scenario where i have to group the PinCode by city name like one city can have many pincode.

I have to do this in winform in datagrid. How can i do this so in datagrid i can see the + and - on before city.

I thing it can be done by nested grid. please, help.


Column A | Column B | Column C

  • Country
    • Zip Code | 10,00 | 15,00
    • Zip Code | 10,00 | 15,00
  • Country
    • Zip Code | 10,00 | 15,00
    • Zip Code | 10,00 | 15,00

Thanks. Shivam

+1  A: 

The DataGridView control does not support expandable/collapsible rows or nested tables. You will have to use a third party control to achieve this.

Alternatively, have a look at this article, which details how to subclass the existing control. This solution does not support databinding, however, which may limit its usefulness.

Bradley Smith
Thanks Bradely,
Shivi
But the link you send me is working but i am not bale to download the project..using (http://www.windowsforms.net/blogs/markrideout/treegridview.zip) that is inside the page
Shivi
Looks like the download is no longer available (was first posted in 2006). I only have a heavily-modified version of the original code, so unfortunately I can't help further. I suggest you look into third party grid controls.
Bradley Smith