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

Display NewRowPosition Button When Adding New Rows

2 Answers 78 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thanos
Top achievements
Rank 1
Thanos asked on 17 Aug 2016, 06:47 PM

Hello,

When I have NewRowPosition set to Bottom, I see the "Click here to add new item" button at the bottom of the GridView, as expected.

My issue is that when I click the NewRow button, the button disappears as I am adding the new row. Note that this only happens when adding a new row - when editing an existing row, the NewRow button appears as expected.

Is there a way to always have the NewRow button shown when adding new rows?

 

Thanks,

-Thanos

2 Answers, 1 is accepted

Sort by
0
Accepted
Stefan Nenchev
Telerik team
answered on 18 Aug 2016, 08:37 AM
Hello Thanos,

You can subscribe to the AddingNewDataItem event of RadGridView and call the CommitEdit and BeginEdit commands consequently through a Dispatcher:

private void clubsGrid_AddingNewDataItem(object sender, Telerik.Windows.Controls.GridView.GridViewAddingNewEventArgs e)
        {
            Dispatcher.BeginInvoke(DispatcherPriority.Background,(Action)(() =>
            {
                this.clubsGrid.CommitEdit();
                this.clubsGrid.BeginEdit();
            }));
        }

Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Thanos
Top achievements
Rank 1
answered on 24 Aug 2016, 07:49 PM

Hey Stephan,

That worked great. Thanks.

Take care,

-Thanos

Tags
GridView
Asked by
Thanos
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Thanos
Top achievements
Rank 1
Share this question
or