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
370
Combobox SelectedItemChanged event fires on XamDataGrid horizontal scroll
posted

Hi, I have a XamDataGrid control in which one of the columns is a ComboBox column. I have a SelectionChangedEvent defines on the ComboBox and it seems to work well in general. But the event seems be firing even if I scroll (down or up, doesn't matter) the Grid. Is this a known issue or am I doing something incorrectly. Please let me know.

Resources Section of XAML

<UserControl.Resources>

<igEditors:ComboBoxItemsProvider x:Key="exceptionlist">
            <igEditors:ComboBoxItemsProvider.Items >
                <igEditors:ComboBoxDataItem DisplayText="Not categorized" Value="0" />
                <igEditors:ComboBoxDataItem DisplayText="Zero Component - Trade level has valid PV" Value="100" />
                <igEditors:ComboBoxDataItem DisplayText="Zero Notional" Value="200" />
                <igEditors:ComboBoxDataItem DisplayText="Zero Fixed Rate" Value="300" />
                <igEditors:ComboBoxDataItem DisplayText="Out of the money trade" Value="400" />
                <igEditors:ComboBoxDataItem DisplayText="Securitised Swap - Notional not yet determined" Value="500" />
                <igEditors:ComboBoxDataItem DisplayText="Trade Dead in Front End - being investigated" Value="600" />
                <igEditors:ComboBoxDataItem DisplayText="Sheet overrides value to Zero" Value="700" />
                <igEditors:ComboBoxDataItem DisplayText="Forward starting float leg" Value="800" />
                <igEditors:ComboBoxDataItem DisplayText="ATM Swap - PV nets to zero" Value="900" />
                <igEditors:ComboBoxDataItem DisplayText="Product at Maturity" Value="1000" />
                <igEditors:ComboBoxDataItem DisplayText="Trade booking to be amended" Value="1100" />
                <igEditors:ComboBoxDataItem DisplayText="Market Data creation failure" Value="1200" />
                <igEditors:ComboBoxDataItem DisplayText="Written down trade" Value="1300" />
                <igEditors:ComboBoxDataItem DisplayText="Under investigation" Value="1400" />
            </igEditors:ComboBoxItemsProvider.Items>
        </igEditors:ComboBoxItemsProvider>

 

<Style x:Key="categoryliststyle" TargetType="{x:Type igEditors:XamComboEditor}" >
            <Setter Property="ItemsProvider" Value="{StaticResource exceptionlist}"/>
            <Setter Property="DropDownButtonDisplayMode" Value="Always"/>
            <!--Setter Property="SelectedItem" Value="{Binding SelectedCategory}"/-->
            <EventSetter Event="SelectedItemChanged" Handler="OnExceptionSelectionChanged"/>
        </Style>

</UserControl.Resources>

 

Below is the XAML for my XamDataGrid

<ig:XamDataGrid x:Name="xdgTradeExceptions" DataSource="{Binding TradeExceptionReport}" Height="650"
                                    Width="auto" ActiveDataItem="{Binding ActiveException, Mode=TwoWay}" GroupByAreaLocation="None"
                                    DataValueChanged="xdgTradeExceptions_DataValueChanged">
                                   
                        <ig:XamDataGrid.Resources>
                            <Style x:Key="reportlevelcolumns" TargetType="{x:Type ig:LabelPresenter}">
                                <Setter Property="Background" Value="LightBlue" />
                            </Style>
                            <Style x:Key="othercolumns" TargetType="{x:Type ig:LabelPresenter}">
                                <Setter Property="Background" Value="LightGreen"/>
                            </Style>
                            <Style TargetType="{x:Type ig:HeaderLabelArea}">
                                <!--Setter Property="FontWeight" Value="Bold"/>
                                <Setter Property="FontFamily" Value="Verdana"/>
                                <Setter Property="FontSize" Value="12"/>
                                <Setter Property="Height" Value="30"/-->
                            </Style>
                        </ig:XamDataGrid.Resources>
                       
                        <ig:XamDataGrid.FieldLayoutSettings>
                            <ig:FieldLayoutSettings DataRecordPresenterStyle="{StaticResource DRPStyle}" SelectionTypeRecord="Extended" AutoGenerateFields="False"/>
                        </ig:XamDataGrid.FieldLayoutSettings>

                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="PreviewMouseRightButtonDown">
                                <actions:RecordActivationAction/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>

                        <ig:XamDataGrid.FieldSettings>
                            <ig:FieldSettings AllowEdit="False" Width="auto" Height="auto"  />
                        </ig:XamDataGrid.FieldSettings>

                        <ig:XamDataGrid.FieldLayouts>
                            <ig:FieldLayout Key="TradeExceptionModel">
                                <ig:FieldLayout.Fields>
                                   
                                    <ig:Field Name="Category" Label="Category Assigned" FixedLocation="FixedToNearEdge">
                                        <ig:Field.Settings>
                                            <ig:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}" EditorStyle="{StaticResource categoryliststyle}"
                                                              LabelPresenterStyle="{StaticResource reportlevelcolumns}" AllowFixing="Near"
                                                              DataValueChangedNotificationsActive="True"
                                                              DataValueChangedHistoryLimit="1">
                                                <ig:FieldSettings.AllowEdit>
                                                    <Binding ElementName="lblIsEntitled" Path="DataContext.IsEntitledToEdit"/>
                                                </ig:FieldSettings.AllowEdit>
                                            </ig:FieldSettings>
                                        </ig:Field.Settings>
                                    </ig:Field>

</ig:FieldLayout.Fields>
                            </ig:FieldLayout>
                        </ig:XamDataGrid.FieldLayouts>



                    </ig:XamDataGrid>

 

Any help is appreciated.

 

Thanks,

Shravan