1

I am wondering if is possible to extend a DataGridVewRow so that I can a container like a Panel that spans under the usual columns. This will be filled with another DataGridView populated with child data. The Panel will be shown/hidden via a button.

This DataGridView will show Master-Detail, parent/ nested child, with expand/collapse functionalty.

Maybe DataGridViewRow is not right correct object to be aiming at extending, however hopefully someone can point me in the right direction.

I'm only looking at being able to add the container, nothing more.

Is it possible? If so, where to start?

Hank
  • 2,456
  • 3
  • 35
  • 83
  • 1
    You may be interested in [this](http://stackoverflow.com/questions/29005397/accordion-in-windows-forms-datagridview/29006361?s=1|0.4367#29006361) – TaW Apr 28 '17 at 10:09
  • Have one issue with this, because the UserControl is parented to the DataGridView it does not scroll with the rows. – Hank Apr 29 '17 at 05:58
  • Yes, this is just an example for starters. You will want to code the Scroll event to adapt the placement of the UC. Other event include adding or deleting Rows before the current one etc.. Note that DGC rows and cells are only virtual, ie they are not controls and have only a limited or rather a very specialized event model – TaW Apr 29 '17 at 08:33
  • Think i understand, so upon scrolling track what rows and UC's are currently visible and manipulate their position accordingly. – Hank Apr 29 '17 at 10:03
  • 1
    I have added an update wrt to scrolling. – TaW Apr 29 '17 at 11:09

1 Answers1

0

TaW's comments solved the issue:

Yes, this is just an example for starters. You will want to code the Scroll event to adapt the placement of the UC. Other event include adding or deleting Rows before the current one etc.. Note that DGC rows and cells are only virtual, ie they are not controls and have only a limited or rather a very specialized event model

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Hank
  • 2,456
  • 3
  • 35
  • 83