3 Replies - 153 Views - Last Post: 28 November 2017 - 05:10 AM Rate Topic: -----

#1 MatthewJ  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 27-November 17

Collapsible Tabular Data View in VB Form

Posted 27 November 2017 - 03:35 AM

Hi All,

I'm trying to display data on a VB form in a tabular layout which can be collapsed and expanded. By default I hope that the summary data will be visible when the form is loaded, but when the user clicks on the "+" at the start of the row, the corresponding detailed-level data will be displayed beneath the row that has focus.

In Microsoft Access this can be achieved by using two datasheet view subforms, linked by a key value, with the detailed-level subform placed into the detail section of the summary-level subform. I can't see a way to do this using the DataGridView tool - is there a way of achieving this? I'm sure I must be missing something obvious, but I can't find anything from searching online.

Thanks for any help you can offer,

Matthew

Is This A Good Question/Topic? 0
  • +

Replies To: Collapsible Tabular Data View in VB Form

#2 andrewsw  Icon User is offline

  • blow up my boots
  • member icon

Reputation: 6541
  • View blog
  • Posts: 26,483
  • Joined: 12-December 12

Re: Collapsible Tabular Data View in VB Form

Posted 27 November 2017 - 03:51 AM

You are describing two slightly different approaches. A DataGridView does not have, by default, expand and collapse buttons/features.

Going by your second description, you can have two related DataGridViews on a form, where selecting a row in one will display child records in the second DataGridView.

Walkthrough: Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls

[I was slightly puzzled by your description, because Access has a feature with +/- buttons, using sub-datasheets, but your second paragraph doesn't describe this "collapsible" feature. Anyway, it isn't available to a DataGridView (out of the box).]
Was This Post Helpful? 0
  • +
  • -

#3 MatthewJ  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 27-November 17

Re: Collapsible Tabular Data View in VB Form

Posted 28 November 2017 - 04:31 AM

Hi,

Thanks for your reply. That is helpful, and I may have to consider that as a solution. But are there no standard tools that would allow me to use the '+/-' functionality in tabular format?

Thanks,

Matthew
Was This Post Helpful? 0
  • +
  • -

#4 maceysoftware  Icon User is offline

  • Foo
  • member icon

Reputation: 353
  • View blog
  • Posts: 1,530
  • Joined: 07-September 13

Re: Collapsible Tabular Data View in VB Form

Posted 28 November 2017 - 05:10 AM

There is no Standard out the box from Microsoft which would allow you to do this, there are plenty of third-party tools which would allow you to do it.

If you're not interested in it being in a datagridview this could be easily achievable using a user control and a table layout control.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1