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
615
Getting first row after sorting
posted

I'm probably overlooking something, but I can't seem to fetch the first row of an UltraCombo after sorting. A row is returned, but it's not the first one.

I'm sorting like this:

machineCodeUltraCombo.DisplayLayout.Bands[0].SortedColumns.RefreshSort(

false);

after that, I tried some different ways of getting the first displayed row:

firstRow = machineCodeUltraCombo.Rows.SingleOrDefault(r => r.VisibleIndex == 0);

firstRow = machineCodeUltraCombo.Rows[0];

firstRow = machineCodeUltraCombo.DisplayLayout.Rows[0];

firstRow = machineCodeUltraCombo.DisplayLayout.Rows.GetRowAtVisibleIndex(0);

 

All these options return the same (wrong) row.

 

 

  • 4219
    posted

    First you should add the columns to the sorted columns collection, like 

    machineCodeUltraCombo.DisplayLayout.Bands[0].SortedColumns.Add("desired column", flag indicator for ascending or descending", Groupby flag);

    And than you could take the FirstRow like:

    firstRow = machineCodeUltraCombo.DisplayLayout.Rows[0];

    About the following line it would refresh the already sorted columns.

      machineCodeUltraCombo.DisplayLayout.Bands[0].SortedColumns.RefreshSort(

    false);

    Please let me know if you have any further questions about this issue.

    Stefaniya,

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support