Hi team ,
I need to get Group Name while grouping using dragging columns in group by area section with new version i.e InfragisticsWPF4.DataPresenter.v18.2
previously it was working fine when i was using v9.2.but after upgradation of infragistic version its not working . Could you plese help for this issue
But now i am unable to get group name after upgrading infragistic version i.e InfragisticsWPF4.DataPresenter.v18.2
Below i mentioned
private void DraggedGroupByCommandExecute(object parameter) //This Event is drag and drop groups { XamDataGrid dg = parameter as XamDataGrid; if (dg == null) return;
var data = dg.GroupByArea.GroupedFieldLabels; //picking favorite group name
}
Hello Sachin,
Thank you for posting in our community.
From the description provided I assume that you want to get the name of the column you are currently grouping by while you dragging. My suggestion for achieving your requirement is handling “Grouping” event where the column name is accessible via the event argument. Depending on your scenario, the name of this column can be stored in a global variable, which will be accessible in any method within your application.
For example:
string nameOfGroupByColumn = null; private void DataGrid_Grouping(object sender, Infragistics.Windows.DataPresenter.Events.GroupingEventArgs e) { nameOfGroupByColumn = e.Groups[0].FieldName; MessageBox.Show(nameOfGroupByColumn); }
Attached you will find small sample illustrating my suggestion.
Please test it on your side and let me know if you need any further assistance.
1106.XamDataGrid_GetGroupNameWhileDragging.zip
We are following MVVM Architecture . below you can see
i am triggering "Grouped" event and with this event I am binding "DraggedGroupByCommand" Icommand and with command parameter we are passing complete xamdatagrid
xaml :
<igDP:XamDataGrid Grid.Row="4" Name="ReportDataGrid" DataSource="{Binding Path=AvailableDocumentList}" IsGroupByAreaExpanded="True">
<i:Interaction.Triggers> <i:EventTrigger EventName="Grouped"> <i:InvokeCommandAction Command="{Binding DataContext.DraggedGroupByCommand,RelativeSource={RelativeSource AncestorType=UserControl}}" CommandParameter="{Binding ElementName=ReportDataGrid}"></i:InvokeCommandAction> </i:EventTrigger>
</igDP:XamDataGrid>
ViewModel :
private void DraggedGroupByCommandExecute(object parameter) //This Event is drag and drop groups{XamDataGrid dg = parameter as XamDataGrid;if (dg == null) return;
I hope now you get more clear picture about requirement .