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.
Syncfusion Feedback

Expand/Collapse all selected rows GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

107421 Feb 28,2013 11:00 AM Oct 6,2013 11:51 PM Windows Forms 10
loading
Tags: GridControl
Gaukhar Massabayeva
Asked On February 28, 2013 11:00 AM

Hi,
 
 
Say I have a number of selected rows and I want to expand /collapse them all through lets say a right click action. What would be the code to expand/collapse only expanded range.
 
Thank you

Gaukhar Massabayeva
Replied On March 4, 2013 07:59 AM

Hi please let me know if my query is unclear. I will try to expand more. Thank you

Gaukhar Massabayeva
Replied On March 5, 2013 04:45 AM

Hello.
 
Anyone knows how to approach this?
 
At the moment here is what i am doing. I will describe how this is not a suitable solution below.
 
GridRangeInfoList range = this.gridControl.TableModel.Selections.GetSelectedRows(true, true);

foreach (GridRangeInfo info in range)
{
        if (info.IsRows)
        {
                    for (int i = info.Top; i <= info.Bottom; i++)
                    {
                         if (this.grdRawData.TableModel.GetDisplayElementAt(i) != null && this.grdRawData.TableModel.GetDisplayElementAt(i).GetRecord() != null)
                                   // attempt #1
                                   this.grdRawData.TableModel.GetDisplayElementAt(i).GetRecord().IsExpanded = true;
                                   // attempt #2
                                   this.grdRawData.TableModel.GetDisplayElementAt(i).GetRecord().SetExpanded(true, true, true);
                    }
                }
 
The problem with these two method is that they are both based on index and after expansion the nested tables takes place of indecies previously assigned to nth selected row.
 
To make it a bit clearer.
 
I have first 4 rows selected after I request expansion only first 2 get expanded.
 
Thank you
                          

Athiram S [Syncfusion]
Replied On March 5, 2013 05:03 AM

Hi Gaukar,

Thanks for your interest in Syncfusion Products.

You can expand or collapse a group and find some contents in it using the code:

http://www.syncfusion.com/downloads/Support/DirectTrac/62881/gridFindDialog_1be3e8c0_989f7d04324297770.zip

Please let me know if you have any concerns.

Regards,
Athiram S

Gaukhar Massabayeva
Replied On March 5, 2013 06:45 AM

Update:
 
I have tried to use
 
SelectedRecordsCollection range = this.grdRawData.Table.SelectedRecords;
foreach (SelectedRecord rec in range)
{
       rec.Record.IsExpanded = true;
}
 
SelectedRecords are empty, I digged into why this could be and found that for the record based selection to work I need to set TableOptions.ListBoxSelectionMode  to something other than None.
 
Now this is not desirable, because that would prevent me from selecting individual cells and this functionality is crucial in my application.
 
But out of curiousity I set TableOptions.ListBoxSelectionMode  to MultiSimple and tried to expand using that and alas SelectedRecords returned as empty.
 
Can someone replicate this?
 

Athiram S [Syncfusion]
Replied On March 5, 2013 06:56 AM

Hi Gaukar,

Sorry for inconvenience. I am afraid that I am  unable to reproduce the issue.

Kindly, attach a sample in order to reproduce the issue. This helps us to provide you with better support.

Regards,
Athiram S

Gaukhar Massabayeva
Replied On March 5, 2013 07:05 AM

Thank you for provided solution but i would rather not rely on index if possible.

I have provided a sample above I wonder if there is a way to do expansion based on selected records but avoiding using index.


Gaukhar Massabayeva
Replied On March 6, 2013 09:09 AM

The issue is now resolved thank you

Athiram S [Syncfusion]
Replied On March 7, 2013 07:39 AM

Hi Gaukar,

Thanks for your update.

We are glad to know that the issue if fixed at your end. If you face any other issues , please open a new forum.

Regards,

Athiram S


Felipe Bahiana Almeida
Replied On September 27, 2013 12:24 PM

would you please tell me how did you solve this issue? I am facing the same thing.

Thank you

Athiram S [Syncfusion]
Replied On October 6, 2013 11:51 PM

Hi  Felipe,

Would you please give us a sample where you face this issue, so that we can sort out the issue and solve it for you.

Please let me know if you have any concerns.

Regards,
Athiram S

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

;