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
55
XamComboEditor displays value member unless it has the focus.
posted

I am creating the ComboBoxItemsProvider in XAML:

    <igDP:XamDataGrid.Resources>
       
<igEditors:ComboBoxItemsProvider x:Key="PhoneTypes" />
   
</igDP:XamDataGrid.Resources>

I am getting a reference to the items provider:

    ComboBoxItemsProvider ItemsProvider =
                     
this.PhoneGrid.FindResource("PhoneTypes") as ComboBoxItemsProvider;

I am filling a ComboBoxItemsProvider with a sorted data view (from a data table):

    ItemsProvider.ItemsSource = dt.DefaultView;

I am setting the display and value paths:

    ItemsProvider.DisplayMemberPath = 'Name';
    ItemsProvider.ValuePath = 'PhoneTypeKey'
;

The problem is that the value (PhoneTypeKey) is being displayed instead of the Name field as designated by the DisplayMemberPath property. If I click into the cell, the value property is correctly replace (visually) by the display property. How do I get the DisplayMember to display when the cell does not have the focus?

Thx,
Tom

 

Parents
No Data
Reply
  • 205
    posted

    I'm experiencing the same issue with xamComboEditor inside a xamDataGrid. I've set the DisplayMemberPath and ValuePaths, but they only seem to be used when that particular cell has focus.

     I've got this as a resource for the window:

    <igEditors:ComboBoxItemsProvider x:Key="locationItems" DisplayMemberPath="Name" ValuePath="ID" ItemsSource="{Binding Source={StaticResource Locations}}" />

    Where Locations is an ObjectDataProvider, and this as my field declaration in the xamDataGrid:

    <igDP:Field Name="LocationID" Label="Location">
      <igDP:Field.Settings>
        <igDP:FieldSettings EditAsType="{x:Type sys:String}" EditorType="{x:Type igEditors:XamComboEditor}">
          <igDP:FieldSettings.EditorStyle>
            <Style TargetType="{x:Type igEditors:XamComboEditor}">
              <Setter Property="ItemsProvider" Value="{StaticResource locationItems}"/>
            </Style>
          </igDP:FieldSettings.EditorStyle>
        </igDP:FieldSettings>
      </igDP:Field.Settings>
    </igDP:Field>

    I believe I've followed all of the examples, but I must be missing something. Has anyone overcome this issue?

    Thanks for feedback

    Mike

Children