Hello
I am building a windows application using the MVVM pattern.
My scenario is as following:
I have a window with several viewmodels in it.
(VM1) Viewmodel containing a list of items displayed through it's view with the help of RadGridView.
(VM2) Viewmodel with a search-like function, given a search criteria it sets the SelectedItem in VM1.
My first problem was that the selecteditem could be out of view. I made a mvvm-exception and added code behind and used ScrollIntoView to solve that problem (works like a charm).
My problem now is that when scrolling occurs, the RadGridView gains focus. Is there any way to prevent this?
Best regards and thanks.
Thomas
I am building a windows application using the MVVM pattern.
My scenario is as following:
I have a window with several viewmodels in it.
(VM1) Viewmodel containing a list of items displayed through it's view with the help of RadGridView.
(VM2) Viewmodel with a search-like function, given a search criteria it sets the SelectedItem in VM1.
My first problem was that the selecteditem could be out of view. I made a mvvm-exception and added code behind and used ScrollIntoView to solve that problem (works like a charm).
private void SelectionChangedHandler(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e) |
{ |
if (this.radGridView.SelectedItem != null) |
{ |
this.radGridView.ScrollIntoView(radGridView.SelectedItem); |
} |
} |
Best regards and thanks.
Thomas