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
60
Scrolling ActiveRow to the center of Ultrawingrid
posted

Hi,

now after hours of searching I can't find a way to scroll an activ row to the center of the grid.

With arrowkeys I navigate through all cells, when pressing ENTER I let the grid sorting the appropiate column and "yes I can"  scroll "ScrollRowIntoView".

ultraGrid1.ActiveRowScrollRegion.ScrollRowIntoView(ultraGrid1.ActiveRow);

But I can't scroll to the center of the grid.

Are there any samples or methods to do this?

Thx Nobbi

Parents
No Data
Reply
  • 20872
    Offline posted

    Hello Nobbi,

    If you would like the ActiveRow to be in the middle of the visible window you could try setting it like the following:

     private void ultraButton1_Click(object sender, EventArgs e) { int i = (int)Math.Floor((double)ultraGrid1.DisplayLayout.RowScrollRegions[0].VisibleRows.Count / 2); ultraGrid1.Rows[ultraGrid1.DisplayLayout.RowScrollRegions[0].FirstRow.Index + i-1].Activate(); } 

    If you would like to scroll the UltraGrid only you should determine what exactly would have to happen using something like the following:

     ultraGrid1.DisplayLayout.RowScrollRegions[0].Scroll(Infragistics.Win.UltraWinGrid.RowScrollAction.LineDown); ultraGrid1.DisplayLayout.RowScrollRegions[0].ScrollPosition = determine where the scroll bar should be; 

    Please feel free to let me know if I missunderstood what you are asking here.

Children