I'm using the XamDataGrid for WPF in version 15.1. I've allowed and denied AllowGroupBy for specific columns. For some columns, once the column header is dragged to the GroupBy header, it cannot be removed. Other columns do not share this behavior - they can be removed. All of the grid columns defined as ComboBoxField, once added to the GroupBy header, cannot be removed from the GroupBy header without closing and re-opening the form. Grid columns defined as CheckBoxField can be added and removed from the GroupBy header without issue. Also, when I drag my first item to the GroupBy header, regardless of what item it is and how it was defined, I get this message in Visual Studio's output window. It does not stop the application.
System.Windows.Media.Animation Warning: 6 : Unable to perform action because the specified Storyboard was never applied to this object for interactive control.; Action='Stop'; Storyboard='System.Windows.Media.Animation.Storyboard'; Storyboard.HashCode='26278481'; Storyboard.Type='System.Windows.Media.Animation.Storyboard'; TargetElement='Infragistics.Windows.DataPresenter.GroupByAreaMulti'; TargetElement.HashCode='27768959'; TargetElement.Type='Infragistics.Windows.DataPresenter.GroupByAreaMulti'
Can anyone provide a recommendation?
Thanks.
Scott
Hello Scott,
I have been investigating this issue, and it appears that what is happening here is an issue with a possible animation or Storyboard with the GroupByAreaMulti element of the XamDataGrid. There are a few of these Storyboards, and so in an attempt to figure out which one this issue is referencing, I have created a sample project with a few different XamDataGrid Field types. At the moment, though, I am unable to reproduce this issue that you are seeing when a specialized Field such as the ComboBoxField gets stuck in the GroupByArea.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem.
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using. I tested against a couple of different versions of Infragistics for WPF 2015.1, namely 15.1.20151.2251 and 15.1.20151.1000.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate Developer
The good news (I guess) is that I'm able to compile and run the application that you sent and it performs as expected. I think the difference may be in the fact that my combo-box's ItemSource can't be filled as part of the visual tree, as I understand it. Each row in my XamDataGrid is an independent ViewModel. As selections are made in a given row, the ItemSource in other combo boxes for the same row will change. Could that be a factor? If so, could you suggest a work-around. I'm pasting the Xaml from my control for your reference.
Thank you.
<UserControl x:Class="Baax.Edge.Wpf.Views.ColumnView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:dataPresenter="http://infragistics.com/DataPresenter" xmlns:local="clr-namespace:Baax.Edge.Wpf.Behaviors" xmlns:igEditors="http://infragistics.com/Editors" xmlns:Converters="clr-namespace:Baax.Edge.Wpf.Converters" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" DataContext="{Binding Path=StructureEditorViewModel, Source={StaticResource Locator} }" > <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="../MainWindowResources.xaml"/> </ResourceDictionary.MergedDictionaries> <Converters:PkToImageConverter x:Key="PkToImageConverter" /> </ResourceDictionary> </UserControl.Resources>
<Grid>
<dataPresenter:XamDataGrid x:Name="ColumnDetailGrid" DataSource="{Binding Columns, IsAsync=True, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}" Grid.Column="0" Grid.Row="0" Margin="5" ActiveDataItem="{Binding Path=SelectedColumn,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" local:XamDataPresenter.DoubleClickCommand="{Binding TryThis}" local:XamDataPresenter.DoubleClickCommandParameter="{Binding ActiveDataItem , RelativeSource={RelativeSource Self}}" >
<dataPresenter:XamDataGrid.Resources> <Style x:Key="imageColumn" TargetType="{x:Type dataPresenter:CellValuePresenter}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type dataPresenter:CellValuePresenter}"> <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"> <Grid> <Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding Converter={StaticResource PkToImageConverter}}" /> </Grid> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style TargetType="{x:Type dataPresenter:CellValuePresenter}" x:Key="IconView"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type dataPresenter:CellValuePresenter}"> <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"> <Rectangle Visibility="Collapsed" Fill="#FFBBBBBB" HorizontalAlignment="Left" Margin="0,1,0,0" x:Name="LeftBorder" VerticalAlignment="Stretch" Width="1" /> <Border Margin="0,1,0,0" x:Name="MainBorder" Grid.Row="0" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}" /> <Image Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Source="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content}" /> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style>
</dataPresenter:XamDataGrid.Resources> <dataPresenter:XamDataGrid.FieldLayoutSettings> <dataPresenter:FieldLayoutSettings AutoGenerateFields="False" HeaderPrefixAreaDisplayMode="FieldChooserButton" SelectionTypeRecord="SingleAutoDrag" DataRecordCellAreaStyle="{StaticResource CellBorders}" FilterUIType="LabelIcons" AllowClipboardOperations="All" CopyFieldLabelsToClipboard="False" SupportDataErrorInfo="RecordsAndCells" DataErrorDisplayMode="ErrorIconAndHighlight" AllowAddNew="False" AllowFieldMoving="WithinLogicalRow" > </dataPresenter:FieldLayoutSettings>
</dataPresenter:XamDataGrid.FieldLayoutSettings> <dataPresenter:XamDataGrid.FieldSettings > <dataPresenter:FieldSettings CellClickAction="EnterEditModeIfAllowed" AllowRecordFiltering="True" FilterLabelIconDropDownType="MultiSelectExcelStyle" DataItemUpdateTrigger="OnCellValueChange" > </dataPresenter:FieldSettings> </dataPresenter:XamDataGrid.FieldSettings> <dataPresenter:XamDataGrid.FieldLayouts> <dataPresenter:FieldLayout DataContext="{Binding SourceElementViewModel, Source={StaticResource Locator}}" > <dataPresenter:FieldLayout.FieldSettings> <dataPresenter:FieldSettings/> </dataPresenter:FieldLayout.FieldSettings> <dataPresenter:FieldLayout.Settings > <dataPresenter:FieldLayoutSettings RecordSelectorNumberFormat="RecordNumberOnly" RecordSelectorNumberType="RecordIndex" SortEvaluationMode="UseCollectionView" FixedFieldUIType="Default" FixedRecordUIType="Default" /> </dataPresenter:FieldLayout.Settings>
<dataPresenter:FieldLayout.Fields>
<dataPresenter:NumericField Label="Order" Name="OrdinalPosition" AllowGroupBy="False" Mask="nnn" AllowFixing="NearOrFar" /> <dataPresenter:Field Label="" Name="PrimaryKeyNumber" CellValuePresenterStyle="{StaticResource imageColumn}" Height="20" Width="20" FixedLocation="FixedToNearEdge" AllowGroupBy="False" AllowFixing="NearOrFar"/>
<dataPresenter:Field Name="KeyIcon" Label="" Width="28" Height="28" > <dataPresenter:Field.Settings> <dataPresenter:FieldSettings CellValuePresenterStyle="{StaticResource IconView}" /> </dataPresenter:Field.Settings> </dataPresenter:Field>
<dataPresenter:TextField Label="Field Name" Name="Name" AllowGroupBy="False" AllowFixing="NearOrFar"/> <dataPresenter:TextField Name="BusinessName" Label="Business Name" AllowGroupBy="False"/>
<dataPresenter:ComboBoxField Label="Data Type" Name="DataType" AllowFixing="NearOrFar" AllowGroupBy="True" > <dataPresenter:ComboBoxField.CellBindings> <dataPresenter:CellBinding Property="ItemsSource" Target="Editor" Binding="{Binding Path=DataItem.AvailableDataTypes}"/> </dataPresenter:ComboBoxField.CellBindings> </dataPresenter:ComboBoxField> <dataPresenter:ComboBoxField Name="DataClass" Label="Data Class" AllowGroupBy="True" AllowFixing="NearOrFar"> <dataPresenter:ComboBoxField.CellBindings> <dataPresenter:CellBinding Property="ItemsSource" Target="Editor" Binding="{Binding Path=DataItem.DataClasses}"/> </dataPresenter:ComboBoxField.CellBindings> </dataPresenter:ComboBoxField>
<dataPresenter:ComboBoxField Name="SelectedTemplate" Label="Element Template" AllowGroupBy="True" AllowFixing="NearOrFar"> <dataPresenter:ComboBoxField.CellBindings>
<dataPresenter:CellBinding Property="ItemsSource" Target="Editor" Binding="{Binding Path=DataItem.AvailableTemplates}" > </dataPresenter:CellBinding > <dataPresenter:CellBinding Target="CellValuePresenter" Property="DisplayMember" Binding="{Binding Path=DataItem.SelectedTemplate}"></dataPresenter:CellBinding> <dataPresenter:CellBinding Property="IsEnabled" Target="Editor" Binding="{Binding Path=DataItem.TemplateAvailableForEdit}" ></dataPresenter:CellBinding> <dataPresenter:CellBinding Property=""></dataPresenter:CellBinding>
</dataPresenter:ComboBoxField.CellBindings>
</dataPresenter:ComboBoxField>
<dataPresenter:NumericField Name="Length" Label="Total Length" Mask="nnn" AllowGroupBy="False" AllowFixing="NearOrFar"> <dataPresenter:NumericField.CellBindings> <dataPresenter:CellBinding Property="IsEnabled" Target="Editor" Binding="{Binding Path=DataItem.CanEditLength, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/> <dataPresenter:CellBinding Property="Visible"></dataPresenter:CellBinding> </dataPresenter:NumericField.CellBindings> </dataPresenter:NumericField> <dataPresenter:NumericField Name="Precision" Label="Decimal Precision" Mask="nn" AllowFixing="NearOrFar" AllowGroupBy="False"> <dataPresenter:NumericField.CellBindings> <dataPresenter:CellBinding Property="IsEnabled" Target="Editor" Binding="{Binding Path=DataItem.CanEditPrecision, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"/> </dataPresenter:NumericField.CellBindings> </dataPresenter:NumericField> <dataPresenter:CheckBoxField Name="PiiInd" Label="PII?" AllowFixing="NearOrFar" AllowGroupBy="True"/> <dataPresenter:ComboBoxField Label="Applicability Type" Name="ApplicabilityType" AllowFixing="NearOrFar" AllowGroupBy="True" DisplayMemberPath="ApplicabilityTypeNme" > <dataPresenter:ComboBoxField.CellBindings> <dataPresenter:CellBinding Property="ItemsSource" Target="Editor" Binding="{Binding Path=DataItem.ApplicabilityTypes}"/> </dataPresenter:ComboBoxField.CellBindings> </dataPresenter:ComboBoxField> <dataPresenter:TextField Label="Applicability Rule" Name="ApplicabilityRule" AllowFixing="NearOrFar" AllowGroupBy="False">
<dataPresenter:TextField.CellBindings> <dataPresenter:CellBinding Property="IsEnabled" Target="CellValuePresenter" Binding="{Binding Path=DataItem.AppRuleEnabled}"/> </dataPresenter:TextField.CellBindings> </dataPresenter:TextField> <dataPresenter:CheckBoxField Name="IsValuable" Label="Valuable?" AllowFixing="NearOrFar" AllowGroupBy="True"/> <dataPresenter:TextField Name="ValuableReason" Label="Value Reason" AllowFixing="NearOrFar" AllowGroupBy="False"> <dataPresenter:TextField.CellBindings> <dataPresenter:CellBinding Property="IsEnabled" Target="CellValuePresenter" Binding="{Binding Path=DataItem.IsValuable}"/> </dataPresenter:TextField.CellBindings> </dataPresenter:TextField> <dataPresenter:ComboBoxField Name="Topic" Label="Topic" AllowFixing="NearOrFar" AllowGroupBy="True"> <dataPresenter:ComboBoxField.CellBindings> <dataPresenter:CellBinding Property="ItemsSource" Binding="{Binding Path=DataItem.Topics}" Target="Editor" ></dataPresenter:CellBinding> </dataPresenter:ComboBoxField.CellBindings> </dataPresenter:ComboBoxField>
<dataPresenter:ComboBoxField Name="ValidDomain" Label="Valid Domain" AllowFixing="NearOrFar" AllowGroupBy="False"> <dataPresenter:ComboBoxField.Settings> <dataPresenter:FieldSettings DataItemUpdateTrigger="OnCellValueChange"/> </dataPresenter:ComboBoxField.Settings> <dataPresenter:ComboBoxField.CellBindings> <dataPresenter:CellBinding Property="ItemsSource" Binding="{Binding Path=DataItem.Domains}" Target="Editor" ></dataPresenter:CellBinding> </dataPresenter:ComboBoxField.CellBindings>
</dataPresenter:ComboBoxField> <dataPresenter:TextField Name="LifeCycleCode" Label="Lifecycle" AllowGroupBy="True" AllowFixing="NearOrFar"/>
<dataPresenter:ComboBoxField Name="SelectedDateRange" Label="Date Range" AllowGroupBy="True" AllowFixing="NearOrFar"> <dataPresenter:ComboBoxField.CellBindings> <dataPresenter:CellBinding Property="ItemsSource" Target="Editor" Binding="{Binding Path=DataItem.ValidDateRanges}"/> <dataPresenter:CellBinding Property="IsEnabled" Target="CellValuePresenter" Binding="{Binding Path=DataItem.DateInd}"></dataPresenter:CellBinding> </dataPresenter:ComboBoxField.CellBindings> </dataPresenter:ComboBoxField> <dataPresenter:ComboBoxField Name="SelectedNumericRange" Label="Numeric Range" AllowGroupBy="True" AllowFixing="NearOrFar" > <dataPresenter:ComboBoxField.CellBindings> <dataPresenter:CellBinding Property="ItemsSource" Target="Editor" Binding="{Binding Path=DataItem.ValidNumericRanges}"/> <dataPresenter:CellBinding Property="IsEnabled" Target="CellValuePresenter" Binding="{Binding Path=DataItem.NumberInd}"/> </dataPresenter:ComboBoxField.CellBindings> </dataPresenter:ComboBoxField> <dataPresenter:TextField Name="Description" Label="Description" AllowGroupBy="True" AllowFixing="NearOrFar"/> <dataPresenter:TextField Name="Comments" Label="Comments" AllowGroupBy="True" AllowFixing="NearOrFar"/> </dataPresenter:FieldLayout.Fields>
</dataPresenter:FieldLayout> </dataPresenter:XamDataGrid.FieldLayouts> </dataPresenter:XamDataGrid> </Grid></UserControl>
Thank you for your update.
I have created a new sample project where the ItemsSources of the ComboBoxFields are dynamic using CellBindings much like the ones you have provided me. I have also kept the FieldLayoutSettings and FieldSettings consistent with the sample code you had sent me as well, but after testing against the latest version of 15.1 (15.1.20151.2251), I am still unable to reproduce this behavior where you are unable to remove a group from the grid.
I have attached this sample project for your review. Please run this on your PC to see whether or not it works correctly on your end. If it does work correctly, it would be very helpful if you could please modify it and send it back, or provide an isolated sample of your own that reproduces this issue that you are seeing.
Thanks for following up and I apologize for the delayed response. I was able to run your application and it performed as expected. I've cloned your settings for the fields and the XamDataGrid in my application, but I still can't remove the filters for any combo-box whose value is set via data binding to an object in the underlying DataItem. Here's some additional information:
Please let me know how I can get around this limitation.
I had thought that the original topic of this forum thread was the inability to remove fields from the grouping area of the XamDataGrid, but I suppose you are having issues with the filters as well?
With the sample project I had sent you, I am still unable to reproduce the filtering and grouping issues that you are seeing in your full application. This leads me to believe that the issue is likely being caused by some sort of setting, or perhaps some styling that is happening in your project. I am also rather unsure of what you are referring to when you say "when a user attempts to drag one of these fields from the filter, the cursor is adorned with a red circle and slash." I am assuming for this you mean that you are trying to drag one of the groups from the group-by area of the XamDataGrid, but I have never seen a red circle or slash when trying to do this.
As you are not seeing these issues with the sample project that I had sent you and I am unable to reproduce these issues that you are referring to, would it be possible for you to please modify the sample project that I had sent you such that it does reproduce these issues that you are seeing and send it back to me? Or, if you have an isolated version of a sample project that reproduces this issue that you are seeing, could you please attach it to this forum thread?