I will need to perform a scroll of the grid (right or left) without navigation through the cells. What I am trying to do is marked the group headers rows (using the backcolor) and when reaching the last visible cell in the grid I will like to scroll it. I will need to determine somehow that I have reach the last visible cell and maybe PerformAction(scroll)?? Is there a way to get the last group header/column visible and scroll it via PerfomrAction?
Thanks,
Mihail
Hi Mihail,
I'm not really sure what you mean by "group headers rows". But you can scroll the grid using methods on the grid.ActiveColScrollRegion. There are several methods on this object to scroll columns into view or control the scoll position of the grid.
To determine the last visible column in the grid, you can use the GetRelatedVisibleColumn method on the column.If you ask for the next column and it returns null, you know there isn't one.
Hi Mike:
Here is my code:
GroupColumnsCollection columns = nextGroup.Columns; if (columns.Count > 0) { //get the first and only column in the group and check if visible UltraGridColumn colingroup = columns[0]; UltraGridColumn col = colingroup.GetRelatedVisibleColumn(VisibleRelation.Next);
}
My group has one column per group, trying to see if next is visible. I am getting the next column, not a null even if the column is far right, outside of the visible area. Even if I check on VisibleRelation.Last I am getting the last column instead of an expected null.
Also true for the group:
UltraGridGroup visible = nextGroup.GetRelatedVisibleGroup(VisibleRelation.Next); if (visible == null) View.SmartGridExcel.ActiveColScrollRegion.Scroll(ColScrollAction.LineRight);
Any ideas?
Sorry,should of been "group headers columns". It will work for me, just want to scroll the grid based on column visibility.