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
570
GroupByRows and Locking ScrollBar
posted

Hi All,

     I have an UltraGrid bound to a BindingSource which is being updated via a backgroundworker. When my  background process is completed, the following method is called:

 

 

 

 

 

 

try

{

 

UltraGridRow  r = dgOrders.DisplayLayout.ActiveRow;

 

 

int firstVisible = dgOrders.ActiveRowScrollRegion.FirstRow.Index;

dgOrders.BeginUpdate();

dgOrders.SuspendLayout();

dgOrders.DataBind();

 

 

if (r != null)

{

dgOrders.ActiveRow = r;

dgOrders.ActiveRowScrollRegion.FirstRow = dgOrders.Rows[firstVisible];

}

dgOrders.ResumeLayout();

dgOrders.EndUpdate();

}

 

 

catch (Exception ex){}

What I'm aiming to do is to keep the current active row activated and to keep the scroll bars from shifting when the grid calls DataBind(). This works perfectly fine when I there are no GroupByRows, when there are GroupByRows the FirstRow property of the grids ActiveScrollRegion ALWAYS returns a GroupByRow (even if a normal UltragridRow is at the top of the visible portion of the grids display area). This makes is very difficult to determine where the first row of the scroll region should be set after the update. 

Has anyone run into something similar when using GroupByRows?

Thanks,

Sean

Parents Reply Children