Current filter:
                                You should refresh the page.
                                  • Hi Team,

                                    I want to do grouping in Excel with C#. Please refer attached my excel screen shot.
                                    I was trying to achieve this using sheet range but sheet rows are dynamic so cant use sheet.Range().
                                    Also tried with AutoOutline() Function.

                                    Please suggest any solution on this

                                    Thanks in Advance

                                1 Solution

                                Creation Date Importance Sort by

                                Hi,

                                There is no built-in way to apply grouping in the desired manner. However, you can manually iterate through all rows, analyze content in "grouping" cells, and add group rows manually. Since your document has a multi-level tree, you need to iterate through all groups recursively.

                                Attached is an example that demonstrates this approach in action. Please test it and let me know whether it helps.

                                Show all comments
                                • K_P 08.07.2019

                                  Hi,

                                  This is perfectly worked for me but last index is getting  grouped under second last element.
                                  i.e.
                                  row no 16 is getting grouped with children of 15's row. Ideally 16 row should be separate.

                                  Please refer attachment for more details

                                • Ingvar (DevExpress Support) 08.08.2019

                                  Hi,

                                  I have slightly changed the last row's calculation routine to fix this issue. Please refer to the sample project I attached.

                                • K_P 08.08.2019

                                  Great.... It worked

                                  initially how to collapse tree. currently tree is getting expanded while opening 

                                • Ingvar (DevExpress Support) 08.08.2019

                                  Hi,

                                  You can use the Worksheet.Rows.CollapseAllGroups method for this purpose. For additional information, review the following help topic:
                                  Data Grouping

                                • K_P 08.08.2019

                                  Thanks a lot...

                                • Ingvar (DevExpress Support) 08.08.2019

                                  You are always welcome!

                                • K_P 08.16.2019

                                  Hi Ingvar,
                                  Is it possible to expand only specified row. Please refer attached screenshot .i.e. only 4th and 6th row should expand.

                                • K_P 08.16.2019

                                  I want to do grouping for all elements but initially want to show some rows in expand and collapse mode. I have row numbers as input. 

                                • Yulia (DevExpress Support) 08.16.2019

                                  Hello,

                                  Usually, we avoid discussing multiple questions within the same thread because this makes it difficult to track the entire conversation. Therefore, I have moved your next question to a separate thread: (T807193: How to collapse certain grouped rows). I will answer you there.