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

how to keep the edit status when add a new dataitem?

2 Answers 46 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 12 Jul 2016, 09:19 AM

Hi, I use a radgridview ,like this:

this.gridUserControl.gridview.ItemsSource = xmlElement.ChildNodes;

add a new dataitem to xmlElement...

this.gridUserControl.gridview.ItemsSource = xmlElement.ChildNodes; //rebinding

int i = gridUserControl.gridview.Items.Count;
XmlElement lastitem = (XmlElement)gridUserControl.gridview.Items[i - 1];
gridUserControl.gridview.SelectedItem = lastitem;
gridUserControl.gridview.BeginEdit();

 

I want to go in the edit status when add a new dataitem directly. It works well. But the problem is that I press any key the first time, the edit status will be ended. And the edit cell's value is the only the press key's value. That's inexplicable. Please help me to solve the problem ,thanks!

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 15 Jul 2016, 08:38 AM
Hi Jonathan,

I tried to reproduce the reported behavior, but to no avail. Can you please check out the attached sample application I used for testing? You should be able to see, that  when a new item is added and the control enters edit mode, only when the Enter key is pressed the edit is committed. 

Additionally, you can take a look at the Managing Data section of RadGridView's online help.

Best Regards,
Stefan X1
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
Jonathan
Top achievements
Rank 1
answered on 29 Jul 2016, 01:34 PM
thank you ,stefan. I think the cause is there are too many events in my program. I'll try your advice to find a solution.
Tags
GridView
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or