Home Forums WinForms controls Xceed Grid for WinForms Iterate rows in grouped/sorted order

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #13200 |

    Hi. I have been asked to write a routine to export data to Excel. The data is in a DataSet and displayed in an Xceed grid. The requirement is that the rows should appear in Excel exactly as they appear in the grid (grouping, sorting, visible columns, etc).

    Can anyone suggest the best approach for iterating over the rows in the correct order, and also knowing where the group subheadings appear, etc?

    Thanks

    kh

    Imported from legacy forums. Posted by kh (had 1882 views)

    User (Old forums)
    Member
    Post count: 23064

    You can get the groups of a gridcontrol from the Groups-property. From each group, you can:
    – retrieve the subheading, by searching the GroupByRow in the HeaderRows-property of the group
    – retrieve the sub-groups, from the Groups-property of the group
    – retrieve the rows from the group, in the correct order, with the GetSortedDataRows-method (pass false as parameter)

    Imported from legacy forums. Posted by Tommy (had 3112 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.