We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Tree behaviour in GGC

Thread ID:

Created:

Updated:

Platform:

Replies:

67687 Aug 28,2007 06:08 AM Sep 24,2007 01:31 PM Windows Forms 12
loading
Tags: Grouping
Paul Sullivan
Asked On August 28, 2007 06:08 AM

Hi,
Can anyone tell me if it is possible to have a tree structure in the GGC with a parent-child relationship
The datasource has an ID column and a ParentID column which describes the relationships. I attach a screen shot of this using another grid product. How do I do this in syncfusion?
Thanks
Paul

TreeGrid.zip

haneefm [Syncfusion]
Replied On August 28, 2007 04:23 PM

Hi Paul,

Here is a minimal sample that implements TreeStructure in a GroupingGrid. Please try this and let me know if this helps.
GroupingGridTree.zip

Currently, the grouping engine has some limited support for such self-relations. Below is a miniaml sample that demonstrates a table that has records with parent references to other records in the table.
SelfRelations.zip

Best regards,
Haneef

Paul Sullivan
Replied On August 29, 2007 04:54 AM

Thanks Haneef that is what I'm looking for (Self Relations),
Just one question - how do I get the expanded rows to show without column headers? (as in my example)
Thanks
Paul

haneefm [Syncfusion]
Replied On August 29, 2007 02:31 PM

Hi Paul,

You can try this code to hide an expanded row ColumnHeader in a GroupingGrid.

this.gridGroupingControl1.NestedTableGroupOptions.ShowColumnHeaders = false;

If you want to hide an expanded CaptionRow(above the ColumnHeaderRow) then try setting the ShowCaption property to false;

this.gridGroupingControl1.NestedTableGroupOptions.ShowCaption = false;

Best regards,
Haneef

Paul Sullivan
Replied On September 4, 2007 11:46 AM

Thanks Haneef,
I have got that to work with my data now. I have some further questions:
1. The example provided seems to rely on "missing" ParentID tags in the source xml file. This really isn't practical, sure - for a demo I can manually edit my xml file but I can't do this in a production system. My ParentID node will just be empty rather than not existing. If I try this here I get every child row repeated outside of the parent node. Is there another way to configure the behaviour so that I can use such a dataset? I have attached suitably named xml samples and my xsd schema.
2. Please view the attached bmp. How do I remove the "expand node" buttons for those rows which have no children?
Thanks
Paul


SelfRel.zip

Paul Sullivan
Replied On September 5, 2007 06:01 AM

Hi Haneef, please ignore point 1. of my last message - I've figured it out - it works if the parentID is null. Please answer point 2. though.
Also, is it possible to reduce or even get rid of the indentation of the child rows so that they line up with the master column headers?
Thanks
Paul

Paul Sullivan
Replied On September 5, 2007 06:39 AM

I am also finding that in this "self relation" mode the grid draws very slowly, and moving with scrollbars is also very slow. I will not be able to use this grid in our product unless this can be sped up. Is there any way to improve this/has this been improved in more recent versions?
VersionInfo = "5.102.0.37";
Thanks
Paul

Paul Sullivan
Replied On September 5, 2007 12:45 PM

Also, I am finding that with the grid in this "mode" if I apply a RecordFilter it has no effect other than to put the filtered records at the top of the grid but still displaying all the (filtered out) records beneath them.
I'm sorry to continually use this forum, really i'd rather not, but the Syncfusion help files are frankly, no help.

Paul Sullivan
Replied On September 6, 2007 12:23 PM

Hi Guys,
I attach an amended version of your example app for self relations. I have one problem now apart from the slowness when loading a large amount of data. The problem is that, as will see when you run my example, when I hide some of the columns in my grid, they are not hidden when I expand the child rows.

SelfRelations.zip

Paul Sullivan
Replied On September 6, 2007 12:43 PM

Apologies, I've figured it out. If anyone wants to know it's possible as follows:
treeList1.TableDescriptor.Relations[0].ChildTableDescriptor.VisibleColumns
=
treeList1.TableDescriptor.VisibleColumns;

Can anone answer the above questions re: indenting of child rows and removal of the "+" button for childless rows?

Thanks for your patience
Paul

haneefm [Syncfusion]
Replied On September 6, 2007 06:55 PM

Hi Paul,

You can handle the QueryCellStyleInfo event of the grid and set the e.Style.CellType property to "Static" for childless records in a GridRecordPlusMinusCell. Below are the codes that show this task.

void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
Element el = e.TableCellIdentity.DisplayElement;
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordPlusMinusCell)
{
Record rec = el.GetRecord();
if (rec.NestedTables.Count > 0 && rec.NestedTables[0].Records.Count == 0 )
{
e.Style.CellType = "Static";
e.Style.Borders.All = new GridBorder(GridBorderStyle.Standard );
}
}
}

Best regards,
Haneef

Paul Sullivan
Replied On September 7, 2007 04:29 AM

Thanks Haneef,
And how do I remove the the child columns' indentation so that they line up with the parent columns
Paul

haneefm [Syncfusion]
Replied On September 24, 2007 01:31 PM

Hi Paul,

To show the nested childs in grid without indenting, you need to set the TableOptions.ShowTableIndent property of the grid to false.

[c#]
grid.TableOptions.ShowTableIndent = false;

Below is a forum thread that discuss with this task.
http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=56982

Best regards,
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;