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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

108188 Apr 8,2013 12:47 PM Apr 19,2013 02:39 AM WPF 1
loading
Tags: Tools
Peter O''Hanlon
Asked On April 8, 2013 12:47 PM

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>

Dinesh Kumar P [Syncfusion]
Replied On April 19, 2013 02:39 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;