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
20
ComboBoxColumn ItemsSource Binding
posted

Hi,

Im trying to bind the items source of a combo box column to a collection of row source object, as the collection items will change per row.  The other columns are binding correctly.

<ig:XamGrid ItemsSource="{Binding Path=Issues}" AutoGenerateColumns="False" >
  <ig:XamGrid.EditingSettings>
    <ig:EditingSettings AllowEditing="Row" IsEnterKeyEditingEnabled="True" IsF2EditingEnabled="True" IsOnCellActiveEditingEnabled="True" />
  </ig:XamGrid.EditingSettings>
  <ig:XamGrid.Columns>
    <ig:TextColumn Key="StartDateTimeLocal" Width="Auto" FormatString="{}{0:d MMM yyyy H:mm:ss}" HorizontalContentAlignment="Right" HeaderText="Start Time" />
    <ig:ComboBoxColumn Key="UserId" Width="120" ItemsSource="{Binding Path=Users}" SelectedValuePath="LookupId" DisplayMemberPath="Name" AllowEditingValidation="False" HeaderText="Users" >
    </ig:ComboBoxColumn>
  </ig:XamGrid.Columns>
</ig:XamGrid>

Thanks

Parents
No Data
Reply
  • 21382
    posted

    You would need to set up your ItemSource to a static resource, if you are going to set it up in Xaml.  The context of the cell would only be the property that is listed via the Key field. So you wouldn't be able to see a secondary property on the data object.

     

     

    <ig:ComboBoxColumn Key="Category
    Width="120
    HorizontalContentAlignment="Stretch"
    ItemsSource="{Binding Source={StaticResource optionsList}}"
    SelectedValuePath="Name"
    DisplayMemberPath="Name" AllowEditingValidation="False">
    

     

Children