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

New row behavior

4 Answers 113 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Frank Beerens
Top achievements
Rank 1
Frank Beerens asked on 08 Oct 2014, 03:15 PM
Hi,

I want to achieve the same 'new row behavior' as the default windows gridview.
That means that if I edit a cell in the 'new row', the row is also added to the datasource and is a 'real' row instead of a 'new row'. Now this only can be achieved by pressing enter or set the focus to another row.

Best regards

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 13 Oct 2014, 10:51 AM
Hello Frank,

Thank you for writing.

In some cases, you may need RadGridView to create a record in the underlying data source after the end-user commits the new row. In other cases, you may want to have a new record created immediately after the end-user starts editing the new row. RadGridView supports both modes. The behavior of RadGridView in this situation is determined by the AddNewBoundRowBeforeEdit property. You can refer to our GridView >> New Row help article >> Adding rows to the underlying data source section which is quite useful about this topic.

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Frank Beerens
Top achievements
Rank 1
answered on 15 Oct 2014, 02:51 PM
Thank you, that got me in the right direction.
The problem I now have is that I use a custom listviewsource, as described in http://www.telerik.com/help/winforms/gridview-populating-with-data-binding-to-a-collection-of-interfaces.html

When I click on the 'new row' now, two rows are added and the last one is in edit mode.
0
Frank Beerens
Top achievements
Rank 1
answered on 16 Oct 2014, 07:46 AM
After some further investigation I found out the problem occurs when using a observablecollection as datasource.

How to reproduce:
Add a new row, fill in any value, press enter so a new line is created and click any existing cell.

I cannot attach an example project here, I created a bug report: 869683
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 20 Oct 2014, 10:05 AM
Hello Frank,

Thank you for writing.

As my colleague, Dimitar, confirmed in the other thread that you have opened, it is an issue with our RadGridView. Here is the feedback item for your reference. The fix will be introduced in Q3 2014 which is scheduled for the end of October. Until then, the possible solution is to use BindingList instead of ObservableCollection.

I hope this information helps. Should you have further questions, I would be glad to help.

Regards,
Desislava
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
GridView
Asked by
Frank Beerens
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Frank Beerens
Top achievements
Rank 1
Share this question
or