How to NOT auto-select the last added row

3 posts, 1 answers
  1. John
    John avatar
    6 posts
    Member since:
    Jul 2013

    Posted 12 Sep 2013 Link to this post

    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. Answer
    Yoan
    Admin
    Yoan avatar
    1180 posts

    Posted 17 Sep 2013 Link to this post

    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 >>
  3. John
    John avatar
    6 posts
    Member since:
    Jul 2013

    Posted 17 Sep 2013 Link to this post

    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
Back to Top