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
170
How to put initial value in XamComboEditor?
posted

Hi --

I'm creating a data grid that has a column of combo boxes.

I've done the example from the Help that attaches an unbound field called "Rating" and gives the user the choice of "5 stars", "4 stars", etc.

When the data grid first appears none of the options is selected.  It's just blank.

How could I set up the XAML to put a default value in this cell at startup?

Thanks

- Dave

 

Parents
  • 9836
    Verified Answer
    posted

    Hi Dave,

    You can try to set SelectedIndex to your XamComboEditor style :

    <igDP:UnboundField Name="rating" Label="Rating">

          <igDP:Field.Settings>

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

                             <igDP:FieldSettings.EditorStyle>

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

                                             <Setter Property="ItemsProvider" Value="{StaticResource cbipRatings}" />

                                           <Setter Property="SelectedIndex" Value="3" />

                                 </Style>

                        </igDP:FieldSettings.EditorStyle>

              </igDP:FieldSettings>

         </igDP:Field.Settings>
    </igDP:UnboundField>

    Regards

    Vlad

Reply Children
No Data