Trouble binding combobox

5 posts, 1 answers
  1. Cheri
    Cheri avatar
    21 posts
    Member since:
    Jan 2012

    Posted 14 Mar 2012 Link to this post




    Hello,

    I am new to Silverlight and am trying to bind a combo box to a RadDomainDatasource.  I am following the example in the Documentation for RadComboBox, Binding to RIA Service.  I know the RadDomainDataSource is working but it doesn't seem to get linked to the ItemsSource property in the combo box (the combo box does not have any items in it).

    I'm sure I am just overlooking something.  Any help would be appreciated.  Or if there is a sample project in the documentation, please send me a pointer.

    Thanks,
    Cheri

    Here is my code snippet.  

       <UserControl.Resources>


                <telerik:RadDomainDataSource x:Key="dds" QueryName="GetOrganizations" AutoLoad="True">
                <telerik:RadDomainDataSource.DomainContext>
                    <server:SSAssetsDomainContext />
                </telerik:RadDomainDataSource.DomainContext>
            </telerik:RadDomainDataSource>


            <DataTemplate x:Key="CustomItemTemplate">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding OrgID}"/>
                    <TextBlock Text=" - "/>
                    <TextBlock Text="{Binding LegalEntity}"/>
                </StackPanel>
            </DataTemplate>


            <DataTemplate x:Key="ComboBoxSimpleTemplate">
                <TextBlock Foreground="Red" Text="{Binding OrgID}" />
            </DataTemplate>
        </UserControl.Resources>
        
        <Grid x:Name="LayoutRoot" Background="White">
            <StackPanel Orientation="Vertical">
                <telerik:RadComboBox x:Name="radComboBox" Height="40" Width="120"
                ItemTemplate="{StaticResource CustomItemTemplate}"
                ItemsSource="{Binding Source={StaticResource dds}, Path=Description}"/>
            <Button Name="btn" Click="btn_Click" Content="Push" Width="200"/>
    </StackPanel>
        </Grid>
    </UserControl>

  2. Answer
    vk
    vk avatar
    46 posts
    Member since:
    Jul 2012

    Posted 15 Mar 2012 Link to this post

    ItemsSource="{Binding Source={StaticResource dds}, Path=DataView}"
  3. DevCraft banner
  4. Cheri
    Cheri avatar
    21 posts
    Member since:
    Jan 2012

    Posted 15 Mar 2012 Link to this post


    I tried these changes but received the same results... nothing in the list.
  5. vk
    vk avatar
    46 posts
    Member since:
    Jul 2012

    Posted 15 Mar 2012 Link to this post

    Sorry, I have corrected my previous post...
  6. Cheri
    Cheri avatar
    21 posts
    Member since:
    Jan 2012

    Posted 15 Mar 2012 Link to this post



    That did it!!  Thank you so much.
Back to Top
DevCraft banner