BL
Bill Langlais
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);
}
}
AD
Administrator
Syncfusion Team
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]);
BL
Bill Langlais
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]);