WHen I have records that extend beyond the view, records become deselected outside of the view. Do mostly right click operations, so need to maintain the selected property, which is bound to the ViewModel. Here is my style that I use on my grids:
ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:igEditors="http://infragistics.com/Editors" xmlns:igDP="http://infragistics.com/DataPresenter" xmlns:converters="clr-namespace:Fox.UI.Resource.Converters"> <converters:IfTrueValueConverter x:Key="BuySellColorConverter" TrueValue="LightGreen" FalseValue="Pink" NullValue="Yellow" CompareTrue="Buy" /> <Style x:Key="FoxXamDataGrid" TargetType="{x:Type igDP:XamDataGrid}" BasedOn="{StaticResource {x:Type igDP:XamDataGrid}}"> <Setter Property="Background" Value="{DynamicResource WorkspaceBackground}" /> <Setter Property="AutoFit" Value="True" /> <Setter Property="GroupByAreaLocation" Value="None" /> <Setter Property="CellContainerGenerationMode" Value="Recycle" /> <Setter Property="RecordContainerGenerationMode" Value="Recycle" /> <Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Recycling" /> <Setter Property="VirtualizingStackPanel.IsVirtualizing" Value="False" /> <Setter Property="ScrollingMode" Value="Immediate" /> <Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Recycling" /> <Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Recycling" /> <Setter Property="igDP:XamDataGrid.ContextMenu"> <Setter.Value> <ContextMenu BorderThickness="0"> <ContextMenu.Resources> <Style TargetType="MenuItem" BasedOn="{StaticResource {x:Type MenuItem}}"> <Setter Property="Background" Value="#186598" /> <Setter Property="Foreground" Value="White" /> <Setter Property="Margin" Value="-2,-1" /> <Setter Property="Padding" Value="2,1" /> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Foreground" Value="Black" /> </Trigger> <Trigger Property="IsMouseOver" Value="False"> <Setter Property="Foreground" Value="White" /> </Trigger> </Style.Triggers> </Style> </ContextMenu.Resources> <MenuItem CommandParameter="SendToWorkflow"> <MenuItem.Icon> <StackPanel Orientation="Horizontal"> <Image Source="/Fox.UI.Resource;component/Images/SendForExecution2.ico" Width="32" Height="32" /> <TextBlock Text="Send to Immediate Execution" VerticalAlignment="Center" /> </StackPanel> </MenuItem.Icon> </MenuItem> <MenuItem CommandParameter="SendToWorkflowDeskSpecific"> <MenuItem.Icon> <StackPanel Orientation="Horizontal"> <!--<Image Source="/Fox.UI.Resource;component/Images/arrow_right.png" />--> <TextBlock Text="Send to Fixing..." VerticalAlignment="Center" /> </StackPanel> </MenuItem.Icon> </MenuItem> <MenuItem CommandParameter="NextFixing"> <MenuItem.Icon> <StackPanel Orientation="Horizontal"> <!--<Image Source="/Fox.UI.Resource;component/Images/arrow_right.png" />--> <Label Content="Next Fixing" VerticalAlignment="Center" /> </StackPanel> </MenuItem.Icon> </MenuItem> <MenuItem CommandParameter="Aggregate"> <MenuItem.Icon> <StackPanel Orientation="Horizontal"> <!--<Image Source="/Fox.UI.Resource;component/Images/arrow_right.png" />--> <Label Content="Aggregate" VerticalAlignment="Center" /> </StackPanel> </MenuItem.Icon> </MenuItem> <MenuItem CommandParameter="TradeDialog"> <MenuItem.Icon> <StackPanel Orientation="Horizontal"> <Image Source="/Fox.UI.Resource;component/Images/Trade.ico" /> <TextBlock Text="Trade..." VerticalAlignment="Center" /> </StackPanel> </MenuItem.Icon> </MenuItem> <MenuItem CommandParameter="CreateBatch"> <MenuItem.Icon> <StackPanel Orientation="Horizontal"> <Image Source="/Fox.UI.Resource;component/Images/Batch.ico" Height="32" Width="32" /> <TextBlock Text="Batch..." VerticalAlignment="Center" /> </StackPanel> </MenuItem.Icon> </MenuItem> <MenuItem CommandParameter="AssignBatch"> <MenuItem.Icon> <StackPanel Orientation="Horizontal"> <Image Source="/Fox.UI.Resource;component/Images/Unassign.ico" /> <TextBlock Text="Assign To Me" VerticalAlignment="Center" /> </StackPanel> </MenuItem.Icon> </MenuItem> <MenuItem CommandParameter="UnassignBatch"> <MenuItem.Icon> <StackPanel Orientation="Horizontal"> <Image Source="/Fox.UI.Resource;component/Images/Unassign.ico" /> <TextBlock Text="Unassign" VerticalAlignment="Center" /> </StackPanel> </MenuItem.Icon> </MenuItem> <MenuItem CommandParameter="SplitOrder"> <MenuItem.Icon> <StackPanel Orientation="Horizontal"> <Image Source="/Fox.UI.Resource;component/Images/Split.png" /> <TextBlock Text="Split Order" VerticalAlignment="Center" /> </StackPanel> </MenuItem.Icon> </MenuItem> <MenuItem CommandParameter="Cancel"> <MenuItem.Icon> <StackPanel Orientation="Horizontal"> <Image Source="/Fox.UI.Resource;component/Images/Cancel.ico" /> <TextBlock Text="Cancel" VerticalAlignment="Center" /> </StackPanel> </MenuItem.Icon> </MenuItem> <MenuItem CommandParameter="GetDetails"> <MenuItem.Icon> <StackPanel Orientation="Horizontal"> <Image Source="/Fox.UI.Resource;component/Images/GetRecordDetails.ico" /> <TextBlock Text="Get Record Details" VerticalAlignment="Center" /> </StackPanel> </MenuItem.Icon> </MenuItem> </ContextMenu> </Setter.Value> </Setter> <Setter Property="igDP:XamDataGrid.FieldSettings"> <Setter.Value> <igDP:FieldSettings AllowFixing="Near" AllowEdit="False" AllowRecordFiltering="True" AllowResize="True" AllowSummaries="True" AutoSizeOptions="All" CellClickAction="SelectRecord" ExpandableFieldRecordHeaderDisplayMode="NeverDisplayHeader" FilterLabelIconDropDownType="MultiSelectExcelStyle" ForceCellVirtualization="True" LabelClickAction="SortByOneFieldOnly" LabelTextAlignment="Center" SummaryDisplayArea="TopFixed" SummaryUIType="MultiSelectForNumericsOnly" Width="Auto" /> </Setter.Value> </Setter> <Setter Property="igDP:XamDataGrid.FieldLayoutSettings"> <Setter.Value> <igDP:FieldLayoutSettings AllowClipboardOperations="Copy" AutoFitMode="OnlyWithVisibleStarFields" AutoGenerateFields="False" DataRecordSizingMode="Fixed" ExpansionIndicatorDisplayMode="Never" FilterUIType="LabelIcons" HeaderPrefixAreaDisplayMode="FieldChooserButton" HighlightAlternateRecords="True" RecordSelectorLocation="LeftOfCellArea" SelectionTypeCell="Extended" /> </Setter.Value> </Setter> </Style> </ResourceDictionary>
Hello,
Thank you for your post. I have been looking into it, but it seems like that I am missing something in your scenario, so if this is still an issue for you, could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
Looking forward for your reply.
You can see if you select that the items are not immediately marked as selected, and scrolling seems to selectively set the IsSelected in the ViewModel.
I can suggest you see these two forum thread:
http://ko.infragistics.com/community/forums/t/62516.aspx
and
http://ko.infragistics.com/community/forums/p/24777/90741.aspx
where it is shown how to bind the IsSelected property.
Hope this helps you.