We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

How to trigger SelectionChanged from GridMultiColumnDropDownList

Hi team,,

I am using GridMultiColumnDropDownList inside sfDataGrid in my application along the lines of MVVM.
I am trying to make use of EventTriggers with EventName = "SelectionChanged" inside GridMultiColumnDropDownList and capture the command on the VM, so that i can do some other implementations.

I observe the SelectionChanged does not get fired when I change the selection.

Similar implementation for SfMultiColumnDropDown works though.

I have attached a sample with similar code for reference. Please let me know how to acheive the SelectionChanged event for GridMultiColumnDropDownList .
Feel free to make modifications for the attached sample, incase it helps.


Thanks,
Srikanth V.

Attachment: SelectionChangedEvent_1adcfbd3.zip

4 Replies

SA Saravanan Ayyanar Syncfusion Team February 6, 2020 05:54 PM UTC

Hi Srikanth, 
 
Thank you for using Syncfusion controls. 
 
Currently we are checking your reported scenario. We will validate this and provide you details on or before 10th February, 2020. We appreciate your patience until then. 
 
Regards, 
Saravanan A. 



SA Saravanan Ayyanar Syncfusion Team February 7, 2020 02:38 PM UTC

Hi Srikanth, 
 
Thank you for your patience. 
 
We have checked your reported scenario. You are tried to access the SelectionChanged event for MultiColumnDropDownList column, but it doesn’t have that event. You need to call the  SfDataGrid.CurrentCellDropDownSelectionChanged event and  declare the event trigger after define columns. Please refer the below code snippet. 
 
<syncfusion:SfDataGrid x:Name="dataGrid" Margin="20" 
                        AllowEditing="True"  SelectionUnit="Cell" 
                        AutoGenerateColumns="False"                              
                        ItemsSource="{Binding OrderList}"                                
                        IsEnabled="{Binding IsObsScreenEnabled}" Grid.Row="1" 
                        HorizontalAlignment="Stretch" ColumnSizer="None"  EnableDataVirtualization="False"   
                        LiveDataUpdateMode="Default"  
                        UseDrawing="Default"  
                        SelectedItem="{Binding Order,UpdateSourceTrigger=PropertyChanged}" 
                        syncfusion:ScrollableContentViewer.VerticalScrollBarVisibility="Visible" 
                        GridCopyOption="CopyData" SelectionMode="Extended"  EditTrigger="OnTap" 
                        GridPasteOption="PasteData" AllowDrop="True" 
                        AllowResizingColumns="True" ScrollMode="Async" AllowFiltering="True" AllowSorting="False"  
                        CanUseViewFilter="True" > 
     <syncfusion:SfDataGrid.Columns> 
         <syncfusion:GridTextColumn MappingName="ProductName" /> 
 
         <syncfusion:GridTextColumn MappingName="ProductId" /> 
 
         <!--SelectionChanged gets DOES NOT fired from here--> 
         <syncfusion:GridMultiColumnDropDownList x:Name="cmbCountry"                                                 
                                                 ItemsSource="{Binding DataContext.Shipcities, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Window}, AncestorLevel=1}}"   
                                                 HeaderText="Country"                                                          
                                                 AutoGenerateColumns="True"                                                             
                                                 MappingName="SelectedShippingLocation"                                                          
                                                 DisplayMember="Country" 
                                                 > 
         </syncfusion:GridMultiColumnDropDownList> 
     </syncfusion:SfDataGrid.Columns> 
     <i:Interaction.Triggers> 
         <i:EventTrigger EventName="CurrentCellDropDownSelectionChanged"> 
             <i:InvokeCommandAction Command="{Binding DataContext.CountryChangedCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type syncfusion:SfDataGrid}, AncestorLevel=1}}" /> 
         </i:EventTrigger> 
     </i:Interaction.Triggers> 
 </syncfusion:SfDataGrid> 
 
 
Modified Sample Link: 
 
UG Link: 
 
Please let us know, if you require further assistance on this. 
 
Regards, 
Saravanan A. 



SV Srikanth Vattipally February 12, 2020 02:12 PM UTC

Hi Saravanan,

Thank you for the response. 
I will try to proceed in the direction provided by you. 


Thanks,
Srikanth V


FP Farjana Parveen Ayubb Syncfusion Team February 13, 2020 05:35 AM UTC

Hi Srikanth, 
 
Thanks for the update. 
 
We will wait to hear from you. 
 
Regards, 
Farjana Parveen A 


Loader.
Live Chat Icon For mobile
Up arrow icon