I have bound datagrid to a dataset with a datarelation defined between
work orders and line items of those work orders.

The default navigation style is to present the [+] at each work order.
You expand, and it shows the name of the datarelation in a new line,
that is shown as a hyperlink. You must THEN click the hyperlink and then
it clears the data grid display, shows the parent work order data at the
top, and then a grid of columns for the line item.

I have seen grids show subordinate records on the same "page" as their
master records, with column headings for the expanded area appropriate
for the line items. How is this done?

RE: Hierarchical presentation style for DataGrid by WhiskyRomeo

WhiskyRomeo
Sat Feb 19 10:41:01 CST 2005

I don't know if this is an option for you but Infragistics UltraGrid does
this nicely with no code.

WR

"Lee Gillie" wrote:

> I have bound datagrid to a dataset with a datarelation defined between
> work orders and line items of those work orders.
>
> The default navigation style is to present the [+] at each work order.
> You expand, and it shows the name of the datarelation in a new line,
> that is shown as a hyperlink. You must THEN click the hyperlink and then
> it clears the data grid display, shows the parent work order data at the
> top, and then a grid of columns for the line item.
>
> I have seen grids show subordinate records on the same "page" as their
> master records, with column headings for the expanded area appropriate
> for the line items. How is this done?
>

Re: Hierarchical presentation style for DataGrid by Tom

Tom
Mon Feb 21 19:08:30 CST 2005


Hierachical Data with the provided windows forms grid control is not
possible. You may have more luck using a tree view in conjunction with a
datagrid. You will probably want to buy a third party control unless you
are up to the challenge.

btw- if you succeed, I could help you get it published. Contact me through
my blog.

--
Tom Krueger

My Blog - http://weblogs.asp.net/tom_krueger
Smart Client DevCenter - http://msdn.microsoft.com/smartclient/
Mobile DevCenter - http://msdn.microsoft.com/mobility

This posting is provided "as is" with no warranties and confers no rights.

"WhiskyRomeo" <WhiskyRomeo@discussions.microsoft.com> wrote in message
news:00FCD1F9-449F-40C5-B245-6731A0F3C348@microsoft.com...
>I don't know if this is an option for you but Infragistics UltraGrid does
> this nicely with no code.
>
> WR
>
> "Lee Gillie" wrote:
>
>> I have bound datagrid to a dataset with a datarelation defined between
>> work orders and line items of those work orders.
>>
>> The default navigation style is to present the [+] at each work order.
>> You expand, and it shows the name of the datarelation in a new line,
>> that is shown as a hyperlink. You must THEN click the hyperlink and then
>> it clears the data grid display, shows the parent work order data at the
>> top, and then a grid of columns for the line item.
>>
>> I have seen grids show subordinate records on the same "page" as their
>> master records, with column headings for the expanded area appropriate
>> for the line items. How is this done?
>>



Re: Hierarchical presentation style for DataGrid by Lee

Lee
Mon Feb 21 23:34:39 CST 2005

Tom Krueger [MSFT] wrote:
> Hierachical Data with the provided windows forms grid control is not
> possible. You may have more luck using a tree view in conjunction with a
> datagrid. You will probably want to buy a third party control unless you
> are up to the challenge.
>
> btw- if you succeed, I could help you get it published. Contact me through
> my blog.
>

I beg to differ - .NET Windows Forms Datagrid does display, and provide
for fully automatic navigation of hierarchical data. It is just not
documented well.

I've done two different ways now. I am at home now, and my code is at
work, so trying to recall the details...

My first was binding to a list I made myself. I think datagrid documents
IList and IEditable for this. One property of the list item was a
collection of homogenous items. When binding this property the data grid
will show the data hierarchically (IList master table / collection for
details table). IIRC the subordinate data of the collection's items was
an in-place representation.

The second approach was to use a dataset with a relationship defined
between two tables. IIRC I bound to the master table, or maybe it was
the relationship?? - I don't have the code here at home to consult. In
this way I had much less code to write, but I don't like the way it
jumps to a detail page, rather than displaying the detail inline. But
navigation between the item level and master level displays is
reasonable. I suspect in this way (with the hyperlink to subordinate
list) one could bind many different related tables and navigate between
them. But since I have only two tables I want to represent, it seems
like a superfluous layer of navigation.

I'll bet there are even more ways to do it though.

I am very familiar with the tree-view approach, and my complaint is the
inability to manage columnar representations with it. Synchronizing a
tree and grid would be possible, but seems problematic. A grid with
hierarchical abilities fits the needs for my current project better.

- Lee

Re: Hierarchical presentation style for DataGrid by Tom

Tom
Tue Feb 22 19:54:22 CST 2005

Hi Lee,

First I would like to apologize, I wasn't clear in my response. I said
"Hierachical Data with the provided windows forms grid control is not
possible." This statement is false. You are correct that the Datagird will
handle hierarchical data. However, I was responding to your need of wanting
the Hierarchical data to show up INLINE with the parent data. So I should
have responsed "Displaying hierarchial data INLINE using the provided
windows forms grid control is not possible." I generally don't like stating
that something is not possible. As a developer I know that pretty much
anything is possible given time and money. So it very well may be possible,
however, it will be difficult. I also say this because I have wanted this
functionality myself for two years and have asked many people if they know
how to do this and the answer is no. It may be that someone has modified
the grid or has created a grid control that does this. Check out
www.CodeProject.com.

Again, if you do figure out how to display hierachical data INLINE using the
provided grid control I will be happy to help you publish an article on it.

Happy Hunting,

Tom



"Lee Gillie" <Nospam@me.com> wrote in message
news:%23g6HICKGFHA.2876@TK2MSFTNGP12.phx.gbl...
> Tom Krueger [MSFT] wrote:
>> Hierachical Data with the provided windows forms grid control is not
>> possible. You may have more luck using a tree view in conjunction with a
>> datagrid. You will probably want to buy a third party control unless you
>> are up to the challenge.
>>
>> btw- if you succeed, I could help you get it published. Contact me
>> through my blog.
>>
>
> I beg to differ - .NET Windows Forms Datagrid does display, and provide
> for fully automatic navigation of hierarchical data. It is just not
> documented well.
>
> I've done two different ways now. I am at home now, and my code is at
> work, so trying to recall the details...
>
> My first was binding to a list I made myself. I think datagrid documents
> IList and IEditable for this. One property of the list item was a
> collection of homogenous items. When binding this property the data grid
> will show the data hierarchically (IList master table / collection for
> details table). IIRC the subordinate data of the collection's items was an
> in-place representation.
>
> The second approach was to use a dataset with a relationship defined
> between two tables. IIRC I bound to the master table, or maybe it was the
> relationship?? - I don't have the code here at home to consult. In this
> way I had much less code to write, but I don't like the way it jumps to a
> detail page, rather than displaying the detail inline. But navigation
> between the item level and master level displays is reasonable. I suspect
> in this way (with the hyperlink to subordinate list) one could bind many
> different related tables and navigate between them. But since I have only
> two tables I want to represent, it seems like a superfluous layer of
> navigation.
>
> I'll bet there are even more ways to do it though.
>
> I am very familiar with the tree-view approach, and my complaint is the
> inability to manage columnar representations with it. Synchronizing a tree
> and grid would be possible, but seems problematic. A grid with
> hierarchical abilities fits the needs for my current project better.
>
> - Lee



Re: Hierarchical presentation style for DataGrid by Lee

Lee
Thu Feb 24 10:00:53 CST 2005

Thanks, Tom -

Sometimes even if the answer to question is "can't be done", it is still
helpful. We all seem to find plenty of reasons to bang our heads on the
wall, and I like to think that such a response may save some bruising to
some tender developer heads, such as mine!

I may return to this as a focus for research, but for the moment I am
going to move on.

Thanks for taking time to share your wisdom.

Best regards - Lee Gillie

Tom Krueger [MSFT] wrote:
> Hi Lee,
>
> First I would like to apologize, I wasn't clear in my response. I said
> "Hierachical Data with the provided windows forms grid control is not
> possible." This statement is false. You are correct that the Datagird will
> handle hierarchical data. However, I was responding to your need of wanting
> the Hierarchical data to show up INLINE with the parent data. So I should
> have responsed "Displaying hierarchial data INLINE using the provided
> windows forms grid control is not possible." I generally don't like stating
> that something is not possible. As a developer I know that pretty much
> anything is possible given time and money. So it very well may be possible,
> however, it will be difficult. I also say this because I have wanted this
> functionality myself for two years and have asked many people if they know
> how to do this and the answer is no. It may be that someone has modified
> the grid or has created a grid control that does this. Check out
> www.CodeProject.com.
>
> Again, if you do figure out how to display hierachical data INLINE using the
> provided grid control I will be happy to help you publish an article on it.
>
> Happy Hunting,
>
> Tom
>
>
>
> "Lee Gillie" <Nospam@me.com> wrote in message
> news:%23g6HICKGFHA.2876@TK2MSFTNGP12.phx.gbl...
>
>>Tom Krueger [MSFT] wrote:
>>
>>>Hierachical Data with the provided windows forms grid control is not
>>>possible. You may have more luck using a tree view in conjunction with a
>>>datagrid. You will probably want to buy a third party control unless you
>>>are up to the challenge.
>>>
>>>btw- if you succeed, I could help you get it published. Contact me
>>>through my blog.
>>>
>>
>>I beg to differ - .NET Windows Forms Datagrid does display, and provide
>>for fully automatic navigation of hierarchical data. It is just not
>>documented well.
>>
>>I've done two different ways now. I am at home now, and my code is at
>>work, so trying to recall the details...
>>
>>My first was binding to a list I made myself. I think datagrid documents
>>IList and IEditable for this. One property of the list item was a
>>collection of homogenous items. When binding this property the data grid
>>will show the data hierarchically (IList master table / collection for
>>details table). IIRC the subordinate data of the collection's items was an
>>in-place representation.
>>
>>The second approach was to use a dataset with a relationship defined
>>between two tables. IIRC I bound to the master table, or maybe it was the
>>relationship?? - I don't have the code here at home to consult. In this
>>way I had much less code to write, but I don't like the way it jumps to a
>>detail page, rather than displaying the detail inline. But navigation
>>between the item level and master level displays is reasonable. I suspect
>>in this way (with the hyperlink to subordinate list) one could bind many
>>different related tables and navigate between them. But since I have only
>>two tables I want to represent, it seems like a superfluous layer of
>>navigation.
>>
>>I'll bet there are even more ways to do it though.
>>
>>I am very familiar with the tree-view approach, and my complaint is the
>>inability to manage columnar representations with it. Synchronizing a tree
>>and grid would be possible, but seems problematic. A grid with
>>hierarchical abilities fits the needs for my current project better.
>>
>>- Lee
>
>
>

Re: Hierarchical presentation style for DataGrid by Tom

Tom
Mon Feb 28 18:08:16 CST 2005

I agree and have plenty of bruises myself.


"Lee Gillie" <Lee@nospam.odp.com> wrote in message
news:e%23LJRooGFHA.3968@TK2MSFTNGP14.phx.gbl...
> Thanks, Tom -
>
> Sometimes even if the answer to question is "can't be done", it is still
> helpful. We all seem to find plenty of reasons to bang our heads on the
> wall, and I like to think that such a response may save some bruising to
> some tender developer heads, such as mine!
>
> I may return to this as a focus for research, but for the moment I am
> going to move on.
>
> Thanks for taking time to share your wisdom.
>
> Best regards - Lee Gillie
>
> Tom Krueger [MSFT] wrote:
>> Hi Lee,
>>
>> First I would like to apologize, I wasn't clear in my response. I said
>> "Hierachical Data with the provided windows forms grid control is not
>> possible." This statement is false. You are correct that the Datagird
>> will handle hierarchical data. However, I was responding to your need of
>> wanting the Hierarchical data to show up INLINE with the parent data. So
>> I should have responsed "Displaying hierarchial data INLINE using the
>> provided windows forms grid control is not possible." I generally don't
>> like stating that something is not possible. As a developer I know that
>> pretty much anything is possible given time and money. So it very well
>> may be possible, however, it will be difficult. I also say this because
>> I have wanted this functionality myself for two years and have asked many
>> people if they know how to do this and the answer is no. It may be that
>> someone has modified the grid or has created a grid control that does
>> this. Check out www.CodeProject.com.
>>
>> Again, if you do figure out how to display hierachical data INLINE using
>> the provided grid control I will be happy to help you publish an article
>> on it.
>>
>> Happy Hunting,
>>
>> Tom
>>
>>
>>
>> "Lee Gillie" <Nospam@me.com> wrote in message
>> news:%23g6HICKGFHA.2876@TK2MSFTNGP12.phx.gbl...
>>
>>>Tom Krueger [MSFT] wrote:
>>>
>>>>Hierachical Data with the provided windows forms grid control is not
>>>>possible. You may have more luck using a tree view in conjunction with
>>>>a datagrid. You will probably want to buy a third party control unless
>>>>you are up to the challenge.
>>>>
>>>>btw- if you succeed, I could help you get it published. Contact me
>>>>through my blog.
>>>>
>>>
>>>I beg to differ - .NET Windows Forms Datagrid does display, and provide
>>>for fully automatic navigation of hierarchical data. It is just not
>>>documented well.
>>>
>>>I've done two different ways now. I am at home now, and my code is at
>>>work, so trying to recall the details...
>>>
>>>My first was binding to a list I made myself. I think datagrid documents
>>>IList and IEditable for this. One property of the list item was a
>>>collection of homogenous items. When binding this property the data grid
>>>will show the data hierarchically (IList master table / collection for
>>>details table). IIRC the subordinate data of the collection's items was
>>>an in-place representation.
>>>
>>>The second approach was to use a dataset with a relationship defined
>>>between two tables. IIRC I bound to the master table, or maybe it was the
>>>relationship?? - I don't have the code here at home to consult. In this
>>>way I had much less code to write, but I don't like the way it jumps to a
>>>detail page, rather than displaying the detail inline. But navigation
>>>between the item level and master level displays is reasonable. I suspect
>>>in this way (with the hyperlink to subordinate list) one could bind many
>>>different related tables and navigate between them. But since I have only
>>>two tables I want to represent, it seems like a superfluous layer of
>>>navigation.
>>>
>>>I'll bet there are even more ways to do it though.
>>>
>>>I am very familiar with the tree-view approach, and my complaint is the
>>>inability to manage columnar representations with it. Synchronizing a
>>>tree and grid would be possible, but seems problematic. A grid with
>>>hierarchical abilities fits the needs for my current project better.
>>>
>>>- Lee
>>
>>