User (Old forums)MemberDecember 22, 2009 at 10:45 amPost count: 23064
Each element in the grid can be brought to view using the BringIntoView method. This method will ensure that the grid element is brought into view no matter its state or its parent state. For example, if the grid element is in a collapsed group, the group will be expanded and the grid scrolled (if necessary) so that the grid element is made visible. The FirstVisibleRow and FirstVisibleColumn properties allow you to change the first/last visible row or column. Setting these properties will automatically bring the newly affected row or column into view. When setting the CurrentCell, CurrentColumn or CurrentRow properties as well as when calling the MoveCurrentCell, MoveCurrentRow and MoveCurrentColumn methods, the BringIntoView method must be called if you want to bring the new current object into view.
The following examples demonstrates how to bring various grid elements into view. Keep in mind that although the examples mostly use rows located within the grid’s DataRows, any other type of row, located in any section of the grid or group (i.e., FixedHeaderRows, FooterRows, etc.) can be brought into view in the same manner.
GridControl1.Groups( GridControl1.Groups.Count – 1 ).BringIntoView()
GridControl1.FirstVisibleRow = GridControl1.DataRows( GridControl1.DataRows.Count – 1 )
GridControl1.FirstVisibleColumn = GridControl1.Columns( GridControl1.Columns.Count – 1 )
GridControl1.CurrentCell = GridControl1.DataRows( GridControl1.DataRows.Count – 1 ).Cells( GridControl1.Columns.Count – 1 )
GridControl1.CurrentColumn = GridControl1.Columns( gridControl1.Columns.Count – 1 )
GridControl1.CurrentRow = GridControl1.DataRows( gridControl1.DataRows.Count – 1 )
gridControl1.Groups[ gridControl1.Groups.Count – 1 ].BringIntoView();
gridControl1.FirstVisibleRow = gridControl1.DataRows[ gridControl1.DataRows.Count – 1 ];
gridControl1.FirstVisibleColumn = gridControl1.Columns[ gridControl1.Columns.Count – 1 ];
gridControl1.CurrentCell = gridControl1.DataRows[ gridControl1.DataRows.Count – 1 ].Cells[ gridControl1.Columns.Count – 1 ];
gridControl1.CurrentColumn = gridControl1.Columns[ gridControl1.Columns.Count – 1 ];
gridControl1.CurrentRow = gridControl1.DataRows[ gridControl1.DataRows.Count – 1 ];
Imported from legacy forums. Posted by Xceed admin (had 2641 views)
- You must be logged in to reply to this topic.