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
140
WinGrid DataSource
posted

Background:
I have an application that contains the UltraWinGrid, and there is enough data to cause a vertical scroll bar, thats fine, the scrolling works fine.

I want to double click rows form the UltraWinGrid to cause a showdialog of a form, works fine.

When the dialog form shows up, and I then close it, I re-assign the UltraWinGrid datasource from the database.

Problem:
When I close the dialog form and re-assign the datasource from the DataTable, the UltraWinGrid goes back to the top, and ignores the fact that I had it scrolled down.

Can somebody please help me with this?

Parents
No Data
Reply
  • 5520
    posted

    before you change the datasource save the following in a variable:

     pos = ultraGrid1.Rows.IndexOf(ultraGrid1.ActiveRowScrollRegion.FirstRow);

    after you change the datasource, set the following:

     ultraGrid1.ActiveRowScrollRegion.FirstRow = ultraGrid1.Rows[pos];

Children