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

How to insert new row?

3 Answers 105 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tor
Top achievements
Rank 1
Tor asked on 18 Nov 2010, 10:10 AM
We want to insert a new row programmatically in top of all the other rows. Using VirtualQueryableCollectionView.AddNew() works but the new item gets added last. How can we achieve this?

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 18 Nov 2010, 10:21 AM
Hi,

 Have you tried Insert() method?

Best wishes,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Tor
Top achievements
Rank 1
answered on 18 Nov 2010, 10:43 AM
I tried that but VirtualQueryableCollectionView.Insert(0, item) results in a blank last row.
0
Vlad
Telerik team
answered on 18 Nov 2010, 10:56 AM
Hi,

This may happen if the item cannot be inserted in the source - for example if the source is simple IEnumerable. If the source collection is at least IList you will not get such problems. Please check the attached example application for reference. 

All the best,
Vlad
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
Tags
GridView
Asked by
Tor
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Tor
Top achievements
Rank 1
Share this question
or