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

Adding New item and then calling CommitEdit adds a new empty row

2 Answers 8 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Shilpi
Top achievements
Rank 1
Shilpi asked on 31 Jan 2014, 05:41 AM
Hi -

I am using NewRowPosition so that the user would have the ability to create a new row by "Click to add new data item", but I populate that row in BeginningEdit and then I want to finish editing so I call CommitEdit from BeginningEdit, but that calls RowEditEnded (which I expect), and also adds a new empty row (which I do not expect)? Am I missing something here?

Thanks, Shilpi

2 Answers, 1 is accepted

Sort by
0
Shilpi
Top achievements
Rank 1
answered on 06 Feb 2014, 10:17 PM
Anything yet?
0
Hristo
Telerik team
answered on 07 Feb 2014, 01:29 PM
Hello Shilpi,

I am sorry for the late answer. The solution to your issue is to set the default values for new item during the event AddingNewDataItem. More information on how to insert new rows to the gridview can be found in this article. I have also attached a sample project demonstrating this approach.

Regards,
Hristo
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

Tags
GridView
Asked by
Shilpi
Top achievements
Rank 1
Answers by
Shilpi
Top achievements
Rank 1
Hristo
Telerik team
Share this question
or