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
4032
RefreshSortPosition does not work
posted

I have a grid with the columns EventType, SortOrder, AccountId, Description. I have grouped by the Column EventType adding this column to the SortedColumns-Collection. I also have set a filter on the underlying binding source and a sort string (sorted by EventType, SortOrder, Description). If the grid comes up, everything looks nice.

Now I have two Buttons on my form, one to move the active row up, one to move down. I get the active row and the appropriate sibling row and swap the SortOrder-value of the two involved rows. After that I call RefreshSortPosition. Nothing happens. The rows does not change their indexes.

I also have tried to reassign the bindingSource sort criteria. Nothinh happens. Rows are displayed at the old position.

What I'm doing wrong here? Thanks for any help.

Parents
  • 4032
    Verified Answer
    Offline posted

    I maybe have found the problem by myself:

    I added all the columns specified in the sort property of the bindingsource also to the SortedColumnsCollection of the grid.

    This seems to be a rule (?) I did not know so far.

    Anyway it seems to be working.

     

Reply Children