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

How to NOT auto-select the last added row

2 Answers 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 12 Sep 2013, 03:02 PM
Hi,

i have a GridView binded to an observable collection of "items" and its SelectedItem property binded to an item in the ViewModel.

Example to explain the behavior that I want to avoid:

I have 3 items in the collection and in the grid I've selected the second row, corresponding to the second element of the collection.
If I add a new element in the collection, the gridview automatically adds a new row for it (and thats ok) and select this new row (which is not ok for me, in this case I want to keep the selection on the second row)

Any idea to achieve this?

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Yoan
Telerik team
answered on 17 Sep 2013, 12:22 PM
Hi John,

I am not sure what exactly happens in your case. I've tried to reproduce the problem you report but to no avail. Could you check my test project and modify it in order to demonstrate the issue? 

Looking forward to hearing from you!

Regards,
Yoan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
John
Top achievements
Rank 1
answered on 17 Sep 2013, 02:35 PM
Hello Yoan,

you are right, the problem that I've descripted...simply doesn't exists.

That behavior simply exists in my case because every row contains a custom control, an editable combobox that select its parent row when its value changes....and when a new row is added the "valuechanged" event is fired so...my bad

Thanks for your example, it helped me to see what was wrong.

Jhon
Tags
GridView
Asked by
John
Top achievements
Rank 1
Answers by
Yoan
Telerik team
John
Top achievements
Rank 1
Share this question
or