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
Hi,
I am also facing the same problem.But with checkbox.Each time i scroll as soon as the top/buttom row hides the checkbox event get fired(if already checked then unchecked event).
Any update?
I had a live chat today morning and a case has been created for this.(CAS-66605-T0B18Y)
Regard,
Sridhar Sahoo
You are right. I still see this behavior. This is an issue with the XamDataGrid.
I have created a support case on your behalf (CAS-50645-HFQGX0) so that you can be notified when this is resolved and the service release is out.
Alex, Thanks for getting back. I already turn off the EditMode on the Combo. Below is the code and I still see my breakpoint being hit if I try to scroll after upon Selection change.
void
e) { e.Handled =
{
e.Handled =
;
).Value.ToString();
) {
); dataRecord.Category = (sender
dataRecord.Category = (sender
).Value.ToString(); (DataContext
(DataContext
).SaveExceptions(dataRecord);
// Get focus out of the combobox
(sender
); (sender
; xdgTradeExceptions.ActiveDataItem =
xdgTradeExceptions.ActiveDataItem =
Hello Shravan,
I apologize for no one getting back to you sooner. This seems to because by the virtualization of the XamDataGrid. I was only able to reproduce this behavior when scrolling the editor outside of the visible area of the XamDataGrid and back in and is because the editor has not ended edit mode properly. One thing to do is to call EndEditMode(...) in the selection changed event :
void OnExceptionSelectionChanged(object sender, RoutedPropertyChangedEventArgs <object > e)
(sender as ValueEditor ).EndEditMode(true , true );
System.Diagnostics.Debug .WriteLine(e.RoutedEvent.Name);
}
If turning off the virtualization is an option for you (expect not to have many records), you can set the RecordContainerGenerationMode to false.
I'm still looking for an answer to this puzzle. Somebody from Infragistics support, Please help. The issue in concern just doesn't make sence the way the ComboBox Editor's SelectionChanged event getting fired on scrolling the XamDataGrid in which the ComboBox is contained.
Please help.