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
125
XamDataGrid - Combo Null value selection
posted

Hi,

 I would like to solve a little problem with selection a null value in the combo placed in the XamDataGrid cell.

Is there an easy way (without adding null item to binded datasource) to choose the null value (like pressing "Esc" or "Delete" key in WinForm controls)?

 

I have found this solution. It´s working, but the XamComboEditor is in editable mode and if I write something (which is not correct value in combo) it´s too slow (I think there is some validation process behind).

<igDP:Field Name="MIC_MDN_ID" Label="Model" Visibility="Visible" Width="120">

  <igDP:Field.Settings>

      <igDP:FieldSettings EditorType="{x:Type igEditors:XamComboEditor}">

         <igDP:FieldSettings.EditorStyle>

             <Style TargetType="{x:Type igEditors:XamComboEditor}">

                <Setter Property="ItemsSource" Value="{DynamicResource MDN}"/>

                <Setter Property="DisplayMemberPath" Value="MDN_Name" />

                <Setter Property="ValuePath" Value="MDN_ID" />

                <Setter Property="IsEditable" Value="True"/>

             </Style>

         </igDP:FieldSettings.EditorStyle>

      </igDP:FieldSettings>

  </igDP:Field.Settings>

</igDP:Field>

in code: this.Resources.Add("MDN", this.DsCar.MDN_ModelName_T);

 

Kind Regards,

  Michal


  • 138253
    Offline posted

    Hello Michal,

     

    It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking through your post and I suggest you add the following Setter in your XamComboEditor’s Style:

     

                    <Setter Property="ComboBoxStyle">
                        <Setter.Value>
                            <Style TargetType="{x:Type ComboBox}">
                                <Setter Property="IsTextSearchEnabled" Value="False"/>
                            </Style>
                        </Setter.Value>
                    </Setter>
    

     

    in order to turn of the text search, which is the reason for the slow performance of the Editor.

     

    Feel free to write me if you have further questions.