Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
7320 | Sep 19,2003 11:12 AM UTC | Sep 20,2003 06:07 AM UTC | WinForms | 4 |
![]() |
Tags: GridControl |
grid.CurrentCell.MoveTo(grid.model.RowCount, 1);
If this does not work, then also call grid.Focus() and set grid.ForceCurrentCellMoveTo = true; to see if that handles it.
If you have EnableAddNew = true, then the row should be one less than the RowCount.
> grid.CurrentCell.MoveTo(grid.model.RowCount, 1);
>
>
> If this does not work, then also call grid.Focus() and set grid.ForceCurrentCellMoveTo = true; to see if that handles it.
>
> If you have EnableAddNew = true, then the row should be one less than the RowCount.
private void cm_ListChanged(object sender, ListChangedEventArgs e) { if(e.ListChangedType == ListChangedType.ItemAdded) { Console.WriteLine(e.NewIndex); this.gridDataBoundGrid1.Focus(); this.gridDataBoundGrid1.CurrentCell.MoveTo(e.NewIndex+1,1); } private void button1_Click(object sender, System.EventArgs e) { CurrencyManager cm = (CurrencyManager)this.BindingContext[dt]; ((IBindingList)cm.List).ListChanged += new ListChangedEventHandler(cm_ListChanged); DataRow dr = dt.NewRow(); dt.Rows.Add(dr); ((IBindingList)cm.List).ListChanged -= new ListChangedEventHandler(cm_ListChanged); }
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.