Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
380
sorting the rows in grid by value
posted

I have a grid. In this grid there are two columns that I need to work on. The thing is that each record in the grid will have a Reference Number which will be column 1. Not unique by the way. So the records will be grouped by column 1.  Each record can be of three types A, B and C which is laid specified in column 2. Also, for each set of records grouped by column 1, they are sorted by column 2 with type A being on top. Are there any built-in grid functions that I can use to accomplish this?

Parents
  • 469350
    Verified Answer
    Offline posted

    Sure. You can group using the grid's OutlookGroupBy feature.

    What I would so is use the InitializeLayout event of the grid.

    Set the layout.ViewStyleBand to OutlookGroupBy to enable grouping.

    Then you do something like this:

    // Group the Reference number column

    e.Layout.Bands[0].SortedColumns.Add(e.Layout.Bands[0].Columns["Reference Number"], false, true);

    // Sort the category column

    e.Layout.Bands[0].SortedColumns.Add(e.Layout.Bands[0].Columns["Category"], false);

Reply Children
No Data