Hierarchical GridDataBoundGrid Sorting issue.

There are two issues I'd like to solve:
- grid doesn't sort second (third, etc.) hierarchy level members (only first level)
- grid collapse each time I changed sort order (column double click)
Any help would be greatly appreciated :)

4 Replies

MI Michal June 20, 2013 12:48 PM UTC

version 9.4


MI Michal June 21, 2013 12:10 PM UTC

            CurrencyManager cm = BindingContext[grid.DataSource, grid.DataMember] as CurrencyManager;
            if (cm != null)
            {
                var defaultView = cm.List as DataView;

                int pos = grid.Model.RowCount;
                for (int i = 0; i < pos; i++)
                {
                    GridBoundRecordState rs = grid.Binder.GetRecordStateAtRowIndex(i);
                    bool True = rs.HasChildList;
                    if (True)
                    {
                        var view = rs.ChildList as DataView;
                        if (view != null)
                        {
                            if (defaultView != null)
                            {
                                view.Sort = defaultView.Sort;
                            }

                            grid.RefreshRange(GridRangeInfo.Rows(i, i + rs.ChildCount));
                            i += rs.ChildCount;
                        }
                    }
                }
            }

Sorting solved ;), still looking for auto-collapsing work around.



AS Athiram S Syncfusion Team June 25, 2013 03:46 AM UTC

Hi Michael,

We are working on this query. we will update with details as soon as possible.

Regards,
Athiram S


AS Athiram S Syncfusion Team July 3, 2013 04:19 AM UTC

Hi Michael,

Sorry for delay in getting back to you.

Please refer to the following forum link for details:


A sample is present in this link. Kindly, refer to the sample for details.

Please let me know if you have any concerns.

Regards,
Athiram S

Loader.
Up arrow icon