Hello.
An example of Select Single Item in Hierarchy in GridView is in SDK.
I changed the xaml property 'SelectionMode' but it didn't work.
How do I solve this?
And is it possible to change it with mvvm? I have to use other views as well.
Thanks.
2 Answers, 1 is accepted
Hello Psyduck,
The parent RadGridView control instance, inside the specified SDK example, has a custom implementation of the SelectionChanged event, which could prevent multiple row selection when the SelectionMode is set to Multiple. You could unsubscribe the parent grid vie element from the SelectionChanged event, and it would allow you to select multiple rows.
Regarding the control through the view model, you could create a new property, which is of type SelectionMode, and bind it to the SelectionMode property of the parent RadGridView control. The following code snippets show this logic's implementation:
public class MyViewModel : INotifyPropertyChanged
{
private SelectionMode currentSelectionMode;
public MyViewModel()
{
this.CurrentSelectionMode = SelectionMode.Multiple;
}
public SelectionMode CurrentSelectionMode
{
get { return currentSelectionMode; }
set { currentSelectionMode = value; OnPropertyChanged(nameof(this.CurrentSelectionMode)); }
}
}
<telerik:RadGridView SelectionMode="{Binding CurrentSelectionMode}" />
With that said, could you give this suggestion a try and let me know how it goes?
Regards,
Stenly
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hello.
My purpose is to want multiple selection of child gridview while including the SDK function.
That is, multi-selection in child gridview. When another child gridview is multi-selected, the selection is deselected in the first child gridview.
What Stenly told me seems to be simply setting the gridview's selectionmode.
Also, something is strange even with the example above. It's not the direction I want it to go.
Thanks.
For your reference, the project you sent me could not be debugged, so I made a new project and tested it.
thank you.