Datagrid in Winform
-
I have a datagrid showing 200+ records, if user scrolls down to select a row that is off the initail screen, can I set the datagrid to show that part of data around the selected row to avoid user using scroll bar again and again. Thanks,
If I understood well, you want to be able to scroll the DataGrid to a certain position. DataGrid has some protected members that you can use to handle scrolling: VertScrollBar, HorizScrollBar, GridVScrolled, GridHScrolled. For vertical scrolling I recommend you to do something like this: public class MyDataGrid:DataGrid { public void ScrollToPos(int position) { ScrollEventArgs sea= new crollEventArgs(ScrollEventType.ThumbPosition,position); this.GridVScrolled(this,sea); } } Best Regards, Daniel Zaharia
-
I have a datagrid showing 200+ records, if user scrolls down to select a row that is off the initail screen, can I set the datagrid to show that part of data around the selected row to avoid user using scroll bar again and again. Thanks,