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
3160
scrolling grid causes xamcomboeditor selecteditemchanged event to fire
posted

In the grid defined below, when the user inputs sufficient rows to cause the vertical scroll bar to appear, then scrolls the grid, the ParameterScopeChanged event fires.  Note the user is not changing any data, they are just using the scroll bar to scroll the visible portion of the grid.  No scroll events are handled.

We are using version 11.2.20112.2125

<igDP:XamDataGrid x:Name="CashParameterGrid"
                                                              GroupByAreaLocation="None"
                                                              DataSource="{Binding CashParameters}"
                                                              ActiveDataItem="{Binding CashParameterGrid_ActiveDataItem, Mode=TwoWay}"
                                                              Grid.Column="0"
                                                              KeyDown="XamDataGrid_KeyDown"
                                                              RecordsDeleting="OnParameterDeleting"
                                                              InitializeTemplateAddRecord="InitParameter"
                                                              RecordUpdating="CashParameterGrid_RecordUpdating"
                                                              RecordUpdated="CashParameterGrid_RecordUpdated"
                                                              RecordAdded="CashParameterGrid_RecordAdded">
                                                <igDP:XamDataGrid.Resources>
                                                    <ResourceDictionary>
                                                        <igEditors:ComboBoxItemsProvider x:Key="ParameterItemsProvider"/>
                                                        <Style x:Key="ParameterScopeStyle" TargetType="{x:Type igEditors:XamComboEditor}">
                                                            <Setter Property="ItemsProvider">
                                                                <Setter.Value>
                                                                    <igEditors:ComboBoxItemsProvider>
                                                                        <igEditors:ComboBoxItemsProvider.Items>
                                                                            <igEditors:ComboBoxDataItem DisplayText="PIMCO" Value="Pimco"/>
                                                                            <igEditors:ComboBoxDataItem DisplayText="Account" Value="Account"/>
                                                                            <igEditors:ComboBoxDataItem DisplayText="Strategy" Value="Strategy"/>
                                                                            <igEditors:ComboBoxDataItem DisplayText="PM" Value="PM"/>
                                                                        </igEditors:ComboBoxItemsProvider.Items>
                                                                    </igEditors:ComboBoxItemsProvider>

                                                                </Setter.Value>
                                                            </Setter>
                                                            <Setter Property="Value" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:CellValuePresenter}}, Path=Value}"></Setter>
                                                            <EventSetter Event="SelectedItemChanged" Handler="ParameterScopeChanged"/>
                                                        </Style>
                                                        <Style x:Key="CashDefStyle" TargetType="{x:Type igEditors:XamComboEditor}">
                                                            <Setter Property="ItemsProvider">
                                                                <Setter.Value>
                                                                    <igEditors:ComboBoxItemsProvider>
                                                                        <igEditors:ComboBoxItemsProvider.Items>
                                                                            <igEditors:ComboBoxDataItem DisplayText="Pure Cash" Value="PureCash" />
                                                                            <igEditors:ComboBoxDataItem DisplayText="Mod2a" Value="Mod2a" />
                                                                            <igEditors:ComboBoxDataItem DisplayText="True Cash" Value="TrueCash"/>
                                                                            <igEditors:ComboBoxDataItem DisplayText="Mod True Cash" Value="ModTrueCash"/>
                                                                            <igEditors:ComboBoxDataItem DisplayText="Liquid Assets" Value="LiquidAssets"/>
                                                                        </igEditors:ComboBoxItemsProvider.Items>
                                                                    </igEditors:ComboBoxItemsProvider>
                                                                </Setter.Value>
                                                            </Setter>
                                                            <Setter Property="Value" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:CellValuePresenter}}, Path=Value}"></Setter>
                                                        </Style>
                                                        <Style x:Key="ComboEditor" TargetType="{x:Type igEditors:XamComboEditor}">
                                                            <Setter Property="Value" Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:CellValuePresenter}}, Path=Value}"></Setter>
                                                        </Style>
                                                        <Style x:Key="AssetPresenterStyle" TargetType="{x:Type igDP:CellValuePresenter}">
                                                            <Setter Property="Template">
                                                                <Setter.Value>
                                                                    <ControlTemplate>
                                                                        <ig:XamMultiColumnComboEditor
                                                                            ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.AssetClasses}"
                                                                            EmptyText="All"
                                                                            AllowDropDownResizing="True"
                                                                            AllowMultipleSelection="True"
                                                                            CheckBoxVisibility="Visible"
                                                                            SelectedItemsResetButtonVisibility="Visible"
                                                                            SelectionChanged="AssetClassesCombo_SelectionChanged"
                                                                            Background="Transparent"
                                                                            Foreground="White"
                                                                            BorderThickness="0"
                                                                            Loaded="XamMultiColumnComboEditor_Loaded">
                                                                            <ig:XamMultiColumnComboEditor.Columns>
                                                                                <ig:TextComboColumn Key="Name" HeaderText="Asset Class"/>
                                                                            </ig:XamMultiColumnComboEditor.Columns>
                                                                        </ig:XamMultiColumnComboEditor>
                                                                    </ControlTemplate>
                                                                </Setter.Value>
                                                            </Setter>
                                                        </Style>
                                                    </ResourceDictionary>
                                                </igDP:XamDataGrid.Resources>
                                                <igDP:XamDataGrid.FieldSettings>
                                                    <igDP:FieldSettings Width="*"
                                                                        LabelClickAction="Nothing"/>
                                                </igDP:XamDataGrid.FieldSettings>
                                                <igDP:XamDataGrid.FieldLayoutSettings>
                                                    <igDP:FieldLayoutSettings AllowDelete="True"
                                                                              AllowAddNew="True"
                                                                              AddNewRecordLocation="OnTop"
                                                                              AllowFieldMoving="WithinLogicalRow"
                                                                              AutoGenerateFields="False"
                                                                              HighlightAlternateRecords="True"
                                                                              RecordSelectorStyle="{StaticResource AddRemoveStyle}"
                                                                              SelectionTypeCell="Extended"
                                                                              SelectionTypeRecord="Extended"/>
                                                </igDP:XamDataGrid.FieldLayoutSettings>
                                                <igDP:XamDataGrid.FieldLayouts>
                                                    <igDP:FieldLayout>
                                                        <igDP:FieldLayout.Fields>
                                                            <igDP:Field Name="Parameter">
                                                                <igDP:Field.Settings>
                                                                    <igDP:FieldSettings EditorStyle="{StaticResource ParameterScopeStyle}"/>
                                                                </igDP:Field.Settings>
                                                            </igDP:Field>
                                                            <igDP:Field Name="Value">
                                                                <igDP:Field.Settings>
                                                                    <igDP:FieldSettings EditorStyle="{StaticResource ComboEditor}"/>
                                                                </igDP:Field.Settings>
                                                            </igDP:Field>
                                                            <igDP:Field Name="CashDefinition" Label="Cash Definition">
                                                                <igDP:Field.Settings>
                                                                    <igDP:FieldSettings EditorStyle="{StaticResource CashDefStyle}"/>
                                                                </igDP:Field.Settings>
                                                            </igDP:Field>
                                                            <igDP:UnboundField Name="AssetClasses" Label="Asset Classes">
                                                                <igDP:UnboundField.Settings>
                                                                    <igDP:FieldSettings CellValuePresenterStyle="{StaticResource AssetPresenterStyle}"/>
                                                                </igDP:UnboundField.Settings>
                                                            </igDP:UnboundField>
                                                            <igDP:Field Name="UseMinCash" Label="Preserve Min Cash"/>
                                                        </igDP:FieldLayout.Fields>
                                                    </igDP:FieldLayout>
                                                </igDP:XamDataGrid.FieldLayouts>
                                            </igDP:XamDataGrid>
                                        </Grid>
                                    </igDock:ContentPane>
                                </igDock:SplitPane>
                                <igDock:ContentPane Header="Cash Holdings"
                                                    igDock:SplitPane.RelativeSize="100,200"
                                                    CloseButtonVisibility="Collapsed"
                                                    WindowPositionMenuVisibility="Collapsed"
                                                    AllowClose="False">
                                    <igDP:XamDataGrid x:Name="CashValuesGrid"
                                                      GroupByAreaLocation="None"
                                                      DataSource="{Binding CashValues}"
                                                      Grid.Row="1">
                                        <igDP:XamDataGrid.FieldSettings>
                                            <igDP:FieldSettings AllowEdit="False"
                                                                Width="*"
                                                                AllowRecordFiltering="True"
                                                                FilterLabelIconDropDownType="MultiSelectExcelStyle"/>
                                        </igDP:XamDataGrid.FieldSettings>
                                        <igDP:XamDataGrid.FieldLayoutSettings>
                                            <igDP:FieldLayoutSettings AllowDelete="False"
                                                                      AllowAddNew="False"
                                                                      AllowFieldMoving="WithinLogicalRow"
                                                                      AutoGenerateFields="False"
                                                                      HighlightAlternateRecords="True"
                                                                      FilterUIType="LabelIcons"
                                                                      RecordSelectorLocation="None"
                                                                      ExpansionIndicatorDisplayMode="CheckOnDisplay"/>
                                        </igDP:XamDataGrid.FieldLayoutSettings>
                                        <igDP:XamDataGrid.FieldLayouts>
                                            <igDP:FieldLayout>
                                                <igDP:FieldLayout.SortedFields>
                                                    <igDP:FieldSortDescription Direction="Ascending"
                                                                               FieldName="ACCT_NO"/>
                                                </igDP:FieldLayout.SortedFields>
                                                <igDP:FieldLayout.Fields>
                                                    <igDP:Field Name="LadderValues"/>
                                                    <igDP:Field Name="ACCT_NO" Label="Account">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings EditorStyle="{StaticResource PoolmanDecimalStyle}"/>
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="PM_NAME" Label="PM"/>
                                                    <igDP:Field Name="STRATEGY_IND" Label="Strategy"/>
                                                    <igDP:Field Name="PURE_CASH" Label="Pure Cash">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings EditorStyle="{StaticResource USDAmountStyle}"/>
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="MV">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings EditorStyle="{StaticResource USDAmountStyle}"/>
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="LIQUIDITY_TARGET" Label="Liquidity Target">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings>
                                                                <igDP:FieldSettings.EditorStyle>
                                                                    <Style TargetType="{x:Type igEditors:XamNumericEditor}">
                                                                        <Setter Property="Format" Value="#0.##%"/>
                                                                    </Style>
                                                                </igDP:FieldSettings.EditorStyle>
                                                            </igDP:FieldSettings>
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="MinCash" Label="Min Cash">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings EditorStyle="{StaticResource USDAmountStyle}"/>
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="SHORT_TBA_CASH" Label="Short TBA Cash">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings EditorStyle="{StaticResource USDAmountStyle}"/>
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="AvailableCash" Label="Spendable Cash">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings AllowEdit="True"
                                                                                EditorStyle="{StaticResource USDAmountStyle}"/>
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                </igDP:FieldLayout.Fields>
                                            </igDP:FieldLayout>
                                            <igDP:FieldLayout Key="LadderValues">
                                                <igDP:FieldLayout.Fields>
                                                    <igDP:Field Name="DERIVED_TYPE" Label="Asset Class"/>
                                                    <igDP:Field Name="MOD2A" Label="Mod2a">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings EditorStyle="{StaticResource USDAmountStyle}"/>
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="TRUE_CASH" Label="True Cash">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings EditorStyle="{StaticResource USDAmountStyle}"/>
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="MOD_TRUE_CASH" Label="Mod True Cash">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings EditorStyle="{StaticResource USDAmountStyle}"/>
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                    <igDP:Field Name="LIQUID_ASSETS" Label="Liquid Assets">
                                                        <igDP:Field.Settings>
                                                            <igDP:FieldSettings EditorStyle="{StaticResource USDAmountStyle}"/>
                                                        </igDP:Field.Settings>
                                                    </igDP:Field>
                                                </igDP:FieldLayout.Fields>
                                            </igDP:FieldLayout>
                                        </igDP:XamDataGrid.FieldLayouts>
                                    </igDP:XamDataGrid>

 

 

 

  • 138253
    Verified Answer
    Offline posted

    Hello Sam,

     

    Thank you for your post. I have been looking into it and I can say that this behavior is expected, because of the virtualization of the XamDataGrid. Also I can suggest you see the sample(“XamComboEditorSelectedItemChanged.zip”) from this post:

     

    http://forums.infragistics.com/forums/p/62364/322218.aspx#322218

     

    where it is shown how to determine whether the event is fired because of the virtualization or by UI interaction.

     

    Hope this helps you.