Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
790
Drag Drop using XamDataGrid
posted

Hi,

I have a XamDataGrid with my own set of defined field layouts. I was trying to implement drag drop from XamDataGrid to another XamDataGrid/XamDataTree using infragistics DragDrop Framework. But it doesn't seem to be working at all. When I drag a row nothing is happening. Could you please help me on how to achieve drag drop using ig dd framework with my own defined field layout.

Sample Code:

<igDataPresenter:XamDataGrid Name="SalesItemDataGrid" Grid.Row="0" Theme="Office2013" GroupByAreaLocation="AboveDataArea"
DataSource="{Binding ActiveNodeSalesItems}"
SelectedDataItems="{Binding SelectedSalesItems}"
SelectedDataItemsScope="RecordsOnly"
ActiveDataItem="{Binding SelectedSalesItemBundle, Mode=TwoWay}">

<igDataPresenter:XamDataGrid.Resources>
<Style TargetType="{x:Type igDataPresenter:DataRecordPresenter}">
<EventSetter Event="MouseRightButtonDown" Handler="XamDataGrid_OnMouseRightButtonDown"/>
</Style>
</igDataPresenter:XamDataGrid.Resources>

<i:Interaction.Behaviors>
<behaviors:XamDataGridFilterBehavior />
</i:Interaction.Behaviors>

<ig:DragDropManager.DropTarget>
<ig:DropTarget IsDropTarget="True" />
</ig:DragDropManager.DropTarget>

<ig:DragDropManager.DragSource>
<ig:DragSource IsDraggable="True" Drop="DragSource_OnDrop" />
</ig:DragDropManager.DragSource>

<igDataPresenter:XamDataGrid.FieldLayoutSettings>
<igDataPresenter:FieldLayoutSettings AutoGenerateFields="False" SelectionTypeRecord="Extended"
HeaderPrefixAreaDisplayMode="FieldChooserButton"
HeaderPresenterStyle="{StaticResource DataGridHeaderStyle}"
AutomationProperties.AutomationId="FieldChooserButton"/>
</igDataPresenter:XamDataGrid.FieldLayoutSettings>

<igDataPresenter:XamDataGrid.FieldSettings>
<igDataPresenter:FieldSettings AllowRecordFiltering="True" AllowEdit="False" CellClickAction="SelectRecord"
ExpandableFieldRecordHeaderDisplayMode="AlwaysDisplayHeader" />
</igDataPresenter:XamDataGrid.FieldSettings>

<igDataPresenter:XamDataGrid.FieldLayouts>
<igDataPresenter:FieldLayout>
<igDataPresenter:UnboundField Label="Name" Name="Name" BindingPath="Name" BindingType="Unbound" />
<igDataPresenter:UnboundField Label="Product Number" Name="ProductNumber" BindingPath="ProductNumber" BindingType="Unbound" />
<igDataPresenter:UnboundField Label="Reference Price" Name="ReferencePrice" BindingPath="ReferencePrice" DataType="{x:Type financial:Money}" BindingType="Unbound" CellValuePresenterStyle="{StaticResource PremiumMoneyEditorViewStyle}"/>
<igDataPresenter:UnboundField Label="Global Price List" Name="GlobalListPrice" BindingPath="GlobalListPrice" DataType="{x:Type financial:Money}" BindingType="Unbound" CellValuePresenterStyle="{StaticResource PremiumMoneyEditorViewStyle}"/>
<igDataPresenter:UnboundField Label="Gross Price" Name="GrossPrice" BindingPath="GrossPrice" DataType="{x:Type financial:Money}" BindingType="Unbound" CellValuePresenterStyle="{StaticResource PremiumMoneyEditorViewStyle}"/>
<igDataPresenter:UnboundField Label="Discount %" Name="UnitaryDiscount.DiscountPercent" BindingPath="UnitaryDiscount.DiscountPercent" BindingType="Unbound" CellValuePresenterStyle="{StaticResource PremiumPercentageEditorViewStyle}"/>
<igDataPresenter:UnboundField Label="Discount" Name="UnitaryDiscount.Value" BindingPath="UnitaryDiscount.Value" BindingType="Unbound" CellValuePresenterStyle="{StaticResource PremiumMoneyEditorViewStyle}"/>
<igDataPresenter:UnboundField Label="Net Price" Name="NetPrice" BindingPath="NetPrice" DataType="{x:Type financial:Money}" BindingType="Unbound" CellValuePresenterStyle="{StaticResource PremiumMoneyEditorViewStyle}"/>
<igDataPresenter:UnboundField Label="Business Unit" Name="BusinessUnit.Name" BindingPath="BusinessUnit.Name" BindingType="Unbound" />
<igDataPresenter:UnboundField Label="Product Area" Name="ProductArea.Name" BindingPath="ProductArea.Name" BindingType="Unbound" />
<igDataPresenter:UnboundField Label="Product Line" Name="ProductLine.Name" BindingPath="ProductLine.Name" BindingType="Unbound" />
<igDataPresenter:UnboundField Label="Fire Code" Name="FireCode.Code" BindingPath="FireCode.Code" BindingType="Unbound" />

.............................
</igDataPresenter:FieldLayout>
</igDataPresenter:XamDataGrid.FieldLayouts>
</igDataPresenter:XamDataGrid>

Thanks,

Sreeni