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
565
ComboBoxColumn DataBinding
posted

This may have been answered already but I can't seem to track anything down on it. I have a XamGrid that contains a ComboBoxColumn. I'd like to bind the ComboBoxColumn to a DomainDataSource. I've added the DomainDataSource as a resource but I can't seem to get the binding to work correctly. Here's some of my XAML that hopefully shows what I'm trying to accomplish:

<Grid x:Name ="LayoutRoot">

<Grid.Resources >

 

 

 

 

 

<riaControls:DomainDataSource AutoLoad="True" x:Key="dsDiv" x:Name="dsDiv" QueryName

="GetNewDeptDivisionsSelect">

 

 

 

 

 

<riaControls:DomainDataSource.DomainContext >

 

 

 

 

 

<my:NewDomainContext />

 

 

 

 

 

</riaControls:DomainDataSource.DomainContext >

 

 

 

 

 

<riaControls:DomainDataSource.QueryParameters >

 

 

 

 

 

<riaControls:Parameter ParameterName="DepartmentID" Value ="0" />

 

 

 

 

 

</riaControls:DomainDataSource.QueryParameters >

 

 

 

 

 

</riaControls:DomainDataSource >

 

 

 

 

 

<riaControls:DomainDataSource AutoLoad="True" x:Key="dsSect" x:Name="dsSect" QueryName ="GetNewDeptSectionsSelect">

 

 

 

 

 

<riaControls:DomainDataSource.DomainContext >

 

 

 

 

 

<my:NewDomainContext />

 

 

 

 

 

</riaControls:DomainDataSource.DomainContext >

 

 

 

 

 

<riaControls:DomainDataSource.QueryParameters >

 

 

 

 

 

<riaControls:Parameter ParameterName="DepartmentID" Value="0" />

 

 

 

 

 

</riaControls:DomainDataSource.QueryParameters>

 

 

 

 

 

</riaControls:DomainDataSource>

 

 

 

 

 

</Grid.Resources>

 

 

 

...and in my grid:

<ig:XamGrid x:Name="ItemGrid" DeleteKeyAction="DeleteSelectedRows" AutoGenerateColumns="False" ItemsSource="{Binding Data, ElementName=dsItem}" Width="900" Height="430">

 

 

 

 

<ig:XamGrid.RowSelectorSettings>

 

 

 

 

<ig:RowSelectorSettings Visibility="Visible" EnableRowNumbering="False"/>

 

 

 

 

</ig:XamGrid.RowSelectorSettings >

 

 

 

 

<ig:XamGrid.Columns >

 

 

 

 

<ig:TextColumn Key="ItemID" HeaderText="Item ID" Visibility="Collapsed" />

 

 

 

 

<ig:TextColumn Key="DepartmentID" HeaderText="Department ID" Visibility="Collapsed" />

 

 

 

 

<ig:TextColumn Key="PItem" Width="250" TextWrapping="Wrap" HeaderText="Item" IsFixed="Left" />

 

 

 

 

<ig:ComboBoxColumn Key="DivisionID" Width="200" HorizontalContentAlignment="Stretch" ItemsSource="{Binding Data, Source={StaticResource dsDiv}}" SelectedValuePath="Division" DisplayMemberPath="DivisionID" AllowEditingValidation="False">

 

 

 

 

</ig:ComboBoxColumn >

Parents Reply
  • 138253
    Offline posted in reply to Brian

    Hello,

    I have been looking into the sample you sent me, but since there wasn’t a backup of your database I wasn’t able to run it and investigate your issue. Despite this I created a sample project for you where I used RIA services and I implemented the functionality you want.

    Hope it helps you.

Children
No Data