Current filter:
                                You should refresh the page.
                                Support Center
                                0
                                  • Hi:

                                    I'm using a ComboBoxEdit as part of the DataGrid Cell. Using the interactivity NS, I consuming the event as the code below show:

                                    [XAML]
                                    <dxc:DXWindow.Resources> <CollectionViewSource x:Key="ProfileSource"/> <DataTemplate x:Key="comboboxEditor"> <dxe:ComboBoxEdit IsTextEditable="False" ItemsSource="{Binding Source={StaticResource ProfileSource}}" ValueMember="profile_id" DisplayMember="name" SelectedItem="{Binding Data.Profile}"> <i:Interaction.Triggers> <i:EventTrigger EventName="SelectedValueChanged"> <i:InvokeCommandAction Command="{Binding ProfileSelectionChangedCommand}" /> </i:EventTrigger> </i:Interaction.Triggers> </dxe:ComboBoxEdit> </DataTemplate> </dxc:DXWindow.Resources>
                                    In my ViewModel I have the following code:
                                    [C#]
                                    ProfileSelectionChangedCommand = new DelegateCommand (ProfileSelectionChanged); public DelegateCommand ProfileSelectionChangedCommand { get; set; } public void ProfileSelectionChanged() { var i = 1; }

                                    The code in the Datagrid is as follow:

                                    [XAML]
                                    <dxg:GridColumn x:Name="Profile" FieldName="ProfileId" CellTemplate="{StaticResource comboboxEditor}" Header="Perfil" Width="Auto" ToolTip="Perfil"> </dxg:GridColumn>

                                    The ComBoxEdit is populated and show the selecteditem as I spected. The problem is when I change the ComboBox value, the SelectedValuechange event did not fire.

                                    Can you tell me what is happening here?

                                    Note: The interactivity NS works fine with GridControl.


                                You must  log in  or  register  to leave comments

                                1 Solution

                                0

                                The ComboBoxEdit doesn't contain the SelectedValueChanged event. Use the SelectedIndexChanged event instead.

                                • Adrián 12.13.2012

                                  Hi Alex:

                                  The ComboBoxEdit does a SelectedValueChanged event

                                  http://documentation.devexpress.com/#WindowsForms/DevExpressXtraEditorsComboBoxEdit_SelectedValueChangedtopic

                                  Using SelectedIndexChanged didn't work either.

                                  Anyway I have solved the problem doing that:

                                  <dxg:GridColumn x:Name="Profile" FieldName="ProfileId" Header="Perfil" Width="Auto" ToolTip="Perfil" AllowEditing="True">
                                                                                  <dxg:GridColumn.CellTemplate>
                                                                                      <DataTemplate>
                                                                                          <dxe:ComboBoxEdit x:Name="PART_Editor" DisplayMember="name" ValueMember="profile_id" >
                                                                                              <dxe:ComboBoxEdit.ItemsSource>
                                                                                                  <Binding Path="Data.AllProfiles">
                                                                                                  </Binding>
                                                                                              </dxe:ComboBoxEdit.ItemsSource>
                                                                                          </dxe:ComboBoxEdit>
                                                                                      </DataTemplate>
                                                                                  </dxg:GridColumn.CellTemplate>
                                                                              </dxg:GridColumn>

                                  and handle the CellValueChanging DataGrid event

                                  Thanks for your answer.

                                • Hello Alejandra,
                                  We are glad to hear that you have found a solution. In the meantime, please note that the SelectedValueChanged event exists only in the WinForms ComboBoxEdit control. In WPF, the ComboBoxEdit control contains only the SelectedIndexChanged event.
                                  Do not hesitate to contact us if you need additional assistance.

                                • Adrián 12.14.2012

                                  Hello Alexander:

                                  You are right. Thanks

                                You must  log in  or  register  to leave comments

                                If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

                                FOLLOW US

                                DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, Silverlight, ASP.NET, WinForms, HTML5 or Windows 8, DevExpress tools help you build and deliver your best in the shortest time possible.

                                Copyright © 1998-2014 Developer Express Inc.
                                All trademarks or registered trademarks are property of their respective owners