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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to prevent a Relation from Displaying A child table

Thread ID:

Created:

Updated:

Platform:

Replies:

47189 Jul 30,2006 07:19 PM UTC Jul 31,2006 08:36 PM UTC WinForms 3
loading
Tags: GridControl
Bill Langlais
Asked On July 30, 2006 07:19 PM UTC

I have a group of 5 nested tables which create a five level expansion of Table1->Table2->Table3->Table4->Table5. This is done with 4 relations. I am also using a set of computed columns to calculate the sum of a set of columns from Table 3 to Table 2 to table 1. It appears computed columns do not work if they are computed from other computed columns (ADO limitation?) So I need to create a relation between Table 1 and Table 3. this fixes my expression issue but creates another nesting directly between table 1 and 3. Is there a way to prevent the grid from using this relatinship when determining which nestings to expand?

Bill Langlais
Replied On July 31, 2006 03:39 AM UTC

Hi,

I tried the following and it seems to work. Any problems with this approach or can you recomend a better approach?

//Called in the GridGroupingControls Initialization code


for(int Inc = 0 ; Inc < P_GridSkiResults->TableDescriptor->Relations->Count ; ++Inc) {
GridRelationDescriptor *grd = P_GridSkiResults->TableDescriptor->Relations->Item[Inc];

if(String::Compare(grd->ChildTableDescriptor->Name, DailyTotalsTable) == 0) {
P_GridSkiResults->TableDescriptor->Relations->Remove(grd);
}
}

Administrator [Syncfusion]
Replied On July 31, 2006 12:26 PM UTC

What you did is OK, but you can try using the relationName as the indexer to retrieve the relation instead of searching for it. In C#, the code would be:

grid.TableDescriptor.Relations.Remove(grid.TableDescriptor.Relations[relationName]);


Here, relationName would be a string that holds the name that was given to the relation when you created it. So, maybe something like this would also work if the indexer accepts a string in MCPP as it does in C#:

P_GridSkiResults->TableDescriptor->Relations->Remove(P_GridSkiResults->TableDescriptor->Relations->Item[relationName]);


Bill Langlais
Replied On July 31, 2006 08:36 PM UTC


Hi,

That should owrk fine in C++. Thanks that is more elegent.

>What you did is OK, but you can try using the relationName as the indexer to retrieve the relation instead of searching for it. In C#, the code would be:

grid.TableDescriptor.Relations.Remove(grid.TableDescriptor.Relations[relationName]);


Here, relationName would be a string that holds the name that was given to the relation when you created it. So, maybe something like this would also work if the indexer accepts a string in MCPP as it does in C#:

P_GridSkiResults->TableDescriptor->Relations->Remove(P_GridSkiResults->TableDescriptor->Relations->Item[relationName]);


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.

Warning Icon 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.Close Icon

;