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
195
Wingrid Refresh Datasource with outlook group by
posted

I have a wingrid that I am trying to refresh the datasource.  I need it to work like outlooks email program which allows emails to come in and keep the display on the current item.  So if the user is scrolled half way down the grid, and the datasource is refreshed it doesn't pop the grid up to the top and the user is confused.  This works great until the user has something in the outlook groupby area.  If I run the code below, it then stops working, without this line it works fine.  Is there a solution to this.  I am using version 10.2.20102.2117

Me.UgridMessages.DisplayLayout.Bands(0).SortedColumns.Add("EnterDate"TrueTrue)
Parents
  • 469350
    Offline posted

    What do you mean by "refresh the datasource"?

    Is the grid scrolling to the top when you group by a column? Or not until later on when you add a row to the data source while the grid is grouped?

    When you group by a column, the grid rows are moved under their respective GroupByRows. So this probably destroys the original row object and creates new UltraGridRows for the data rows. Which means there's no way the grid can maintain the scroll position, since the rows are no longer what they were.

    If that is what's happening, then what you would have to do is store some sort of key information from the row before you group. Then you would have to loop through the grid rows recursively to find the new row with the same data, expand it's parent(s) and scroll it into view.

Reply Children