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.

Grouping Grid Related Table Selected Records

Thread ID:

Created:

Updated:

Platform:

Replies:

52081 Nov 21,2006 11:01 AM Nov 22,2006 12:08 AM Windows Forms 1
loading
Tags: GridControl
Josh Collins
Asked On November 21, 2006 11:01 AM

I have a scenario where the grouping grid is bound to a collection which a child collection.

A GridRelationDescriptor is added using the public property of the child collection to create the hierarchy.

The grid builds out correctly, however when I attempt to query the selected records of the grid I can only retrieve the selected rows of the top-level.

The grid is set to have the MultiExtended selection mode as well as the GridSelectionFlags set to None as per some other examples posted.

Below are a list of properties interrogated and the value returned:

grid.Table.SelectedRecords.Count = 1 (Top level selected record, this is correct).

grid.Table.RelatedTables.Count = 1 (There is only 1 sub collection, this is correct).

grid.Table.RelatedTables[0].SelectedRecords.Count = 0 (This is incorrect, several are selected)

grid.Table.RelatedTables[0].Records.Count = 0 (This is definitely incorrect, there are items in the collection which are displayed as rows)

I have seen other samples provided using data sets, however using object entities the same methodologies are not working.

Thanks,
jc

Administrator [Syncfusion]
Replied On November 22, 2006 12:08 AM

Hi Josh,

In a flat groupinggrid, you can get the selected records in this manner.

GridTable gt = this.gridGroupingControl1.Table;
foreach(SelectedRecord rec in gt.SelectedRecords)
{
Console.WriteLine(rec.Record);
}

With the nested tables, you need to get the child table you want, and do the same type of thing. Here is a code snippet

GridTable gt = this.gridGroupingControl1.GetTable("ChildTable");
foreach(SelectedRecord rec in gt.SelectedRecords)
{
Console.WriteLine(rec.Record);
}

Please refer to the attached sample for getting selected record in a grid.
http://www.syncfusion.com/Support/user/uploads/GGC_HideTable_4d9308b7.zip

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.

;