This is a migrated thread and some comments may be shown as answers.

Insert new record into RadGridView

1 Answer 74 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Trump
Top achievements
Rank 1
Trump asked on 14 Apr 2018, 12:02 PM

Hi,

I have a button outside the RadGridView. What I want is to click the button to insert new record to the RadGridView. The problem is that I have a DataPager. It seems to prevent me to insert a new record because I have page size set up.

Or maybe I have to go to last page once I click this button? How to do it?

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 18 Apr 2018, 10:47 AM
Hi Trump,

When you add a new record to the RadGridView you can change the current page. You can subscribe to the AddingNewDataItem event of the RadGridView. In the event handler, you can set the PageIndex property of the RadDataPager control to the last page.
private void radGridView_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
{
    var lastDataPagerIndex = this.radDataPager.PageCount;
    this.radDataPager.PageIndex = lastDataPagerIndex -1;
}

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
DataPager
Asked by
Trump
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or