We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Use of GroupViewItemDragStartCommand with syncfusion:GroupView.ItemContainerStyle in a WPF MVVM application

So, I've used the following code to create a GroupView that binds to an ObservableCollection. What I want to do is associate the GroupViewItemDragStartCommand.Command with the items in the GroupView. As you can appreciate, you can't associate GroupViewItemDragStartCommand.Command with the style, so does anyone have any suggestions on associating this?
<syncfusion:GroupView x:Name="gView" Orientation="Horizontal" ItemsSource="{Binding SomeCollection}">
    <syncfusion:GroupView.ItemContainerStyle>
        <Style TargetType="{x:Type syncfusion:GroupViewItem}" BasedOn="{StaticResource BlendGroupViewItemStyle}">
            <Setter Property="Text" Value="{Binding Name, Mode=OneWay}"/>
            <Setter Property="Height" Value="50" />
            <Setter Property="Width" Value="50" />
            <Setter Property="IsManipulationEnabled" Value="True" />
            <Setter Property="ImageSource" Value="{Binding ImagePath, Mode=OneWay}"/>
        </Style>
    </syncfusion:GroupView.ItemContainerStyle>
</syncfusion:GroupView>

1 Reply

DK Dinesh Kumar P Syncfusion Team April 19, 2013 06:39 AM UTC

Hi Peter,

Sorry for the delay.

We can set 'GroupViewItemDragStartCommand.Command' in the Setter by binding a command with that. We have created a simple sample which can be download attached with this forum. In the sample, we have binded GroupView with an ObservableCollection and associated 'GroupViewItemDragStartCommand' in the ItemContainerStyle of GroupView control. Whenever 'DragStart' occurs 'ExecuteDragStart()' in Model class would get fired.

Please let us know in case of any other queries.

Thanks and Regards,
Dinesh Kumar P


GropuViewCommand_F108188_414cef7a.zip

Loader.
Live Chat Icon For mobile
Up arrow icon