Home Forums WPF controls Xceed DataGrid for WPF Navigation using buttons

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26736 |

    Hello !!

    I’ve tried to navigate the grid using a toolbar with buttons. A sample Click event handler code is the following:

    ———————————————————————-

    private void Button_Click(object sender, RoutedEventArgs e)
    {
    ((DataGridCollectionViewSource)this.grid.FindResource(“gridCollectionViewSource”)).View.MoveCurrentToLast();
    this.grid.SelectedItem = this.grid.CurrentItem;
    }

    ———————————————————————–

    If i’m editing one cell before click the button, the editing ends, but the grid viewport doesn’t move or refresh to view the last record of the grid.

    How can I achieve this ?

    thanks !!!

    Imported from legacy forums. Posted by Miguel (had 2529 views)

    User (Old forums)
    Member
    Post count: 23064

    Sorry, the correct code for the event handler is the following:

    private void Button_Click(object sender, RoutedEventArgs e)
    {
    ((DataGridCollectionViewSource)this.FindResource(“gridCollectionViewSource”)).View.MoveCurrentToLast();
    this.grid.SelectedItem = this.grid.CurrentItem;
    }

    If i’m editing one cell before click the button, the editing ends, but the grid viewport doesn’t move or refresh to view the last record of the grid.

    How can I achieve this ?

    thanks !!!

    Imported from legacy forums. Posted by Miguel (had 506 views)

    Xceed Support
    Member
    Post count: 5658

    You can use the grid’s BringItemIntoView method to bring the last record into the viewport.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 3368 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.