Home Forums WinForms controls Xceed Grid for WinForms Recursive parameter of GetSortedDataRows

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

    The grid control has a method to get the list of data rows of the grid. The method is called GetSortedDataRows, and it has a parameter called “recursive.” The documentation states that this parameter should be set to “true if all the data rows of the grid should be retrieved; false otherwise.”

    What is the purpose of this parameter? If I set it to “false,” which data rows are returned and which are not? If I set it to “true,” is it supposed to return data rows in detail grids? If so, is there a way to differentiate detail grid rows from master grid rows?

    Jon Z

    Imported from legacy forums. Posted by AlphaGuys (had 2153 views)

    User (Old forums)
    Member
    Post count: 23064

    If you set the recursive parameter to false, it will only return the DataRows for the group you are in. For example, if your master grid is group by a column, and you only want the rows in the first group, you would do this :
    <i>
    ReadOnlyDataRowList list = gridControl1.Groups[ 1 ].GetSortedDataRows( false );
    </i>
    Note that the following would return 0 data rows if all the rows are in groups :
    <i>
    ReadOnlyDataRowList list = gridControl1.GetSortedDataRows ( false );
    </i>
    GetSortedDataRows always return rows only for the grid you are in, i.e., it will not return the rows in the DetailGrids if you are at the master grid level. So if you want the sorted DataRows of a detail grid, you need to do something like the following :
    <i>
    ReadOnlyDataRowList list = gridControl1.DataRows[ 0 ].DetailGrids[ 0 ].GetSortedDataRows ( false );
    </i>

    Imported from legacy forums. Posted by André (had 3022 views)

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