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

Newly added item disappears

3 Answers 44 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Berthold
Top achievements
Rank 1
Berthold asked on 19 Apr 2011, 08:12 AM
Hi,
I'm using  the insert-Button inside the grid to add new items.
In my grid there are a lot of items - so the scrollbar is visible.  
So, after  adding the new item slided down to a invisibile row (as long the user don't use the scrollbar).
(that's because of the user defined sorting) 
I know, after adding the grid will be sorted  automatically - but that's a bit confusing for the user.

Is there an easy way to keep the new item at the top of the list?

Thanks
Berthold

3 Answers, 1 is accepted

Sort by
0
Yordanka
Telerik team
answered on 19 Apr 2011, 08:28 AM
Hi Berthold,

You can add items using the build-in insert row by setting ShowInsertRow="True". In this way the new row will be always on top. More information can be found here.
Let us know in case your requirements are different and the purposed solution is not appropriate.

 
All the best,
Yordanka
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Berthold
Top achievements
Rank 1
answered on 19 Apr 2011, 08:52 AM
Hi,

thanks for your answer.
But I'm using the ShowInsertRow="True". And this row is always on top.
But after the adding process is done, the item disappears - that's because of the sorting.

See the attached screenshot

Thanks
Berthold
0
Yordanka
Telerik team
answered on 21 Apr 2011, 10:21 AM
Hi Berthold,

If the new item is committed using Enter key for example, you may create a custom keyboard command provider as demonstrated in this blog post. You could reset the default behavior of the Enter key and on KeyDown event to call CommitEdit(). After that on RowEditEnded you can scroll to the newly added item using ScrollIntoViewAsync().

Let us know if you need further assistance or the purposed solution is not applicable for your case. 
 
All the best,
Yordanka
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Berthold
Top achievements
Rank 1
Answers by
Yordanka
Telerik team
Berthold
Top achievements
Rank 1
Share this question
or