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
190
Grid Sorting
posted

I am building a data source sorted the way I want, which is 

     list.OrderBy(x => x.EffectiveDate).ThenBy(x => x.InstallmentDate).ThenBy(x => x.SortOrder).ToList();

Then, in the InitializeLayout I have

    e.Layout.Bands[0].Columns["EffectiveDate"].SortIndicator = SortIndicator.Ascending;
    e.Layout.Bands[0].Columns["PostDate"].SortIndicator = SortIndicator.Ascending;
    e.Layout.Bands[0].Columns["InstallmentDate"].SortIndicator = SortIndicator.Ascending;

As soon as this code runs, the grid is no longer sorted by my query, but by these 3 columns. How do I load the grid sorted the way I want, and still show the sort indicators for later use?

Thanks

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    I don't understand exactly what you mean, You are sorting the grid by different fields than the data source. So, of course, the order of the rows will be different. How could it not be?

    If you are using the latest version of the grid, then you might be able to use the "External" SortIndicator options which display the sort indicator but don't actually do any sorting. But when the user clicks the column header, the grid will not do any sorting - it will expect you to perform the sort yourself.

Children