RadComboBox from DataSources

3 posts, 0 answers
  1. Almond
    Almond avatar
    43 posts
    Member since:
    Feb 2011

    Posted 16 Feb 2011 Link to this post

    Good day to all.

    I have been looking for a solution for my problem for two days and I have seen some threads that have the same scenario as of what I am trying to implement.

    I would just like to ask why is it that my RadComboBox is working and getting the data from the DataSource if its outside a DataForm, however, when i tried to insert the same RadComboBox in the DataForm, nothing is happening. 

    Basically I have to Tables, Supplier and Country. Supplier has a fields that country which saves the countryID from the country table and i want to display the corresponding countryName from the country table based on that countryID. 

    if i am outside a DataForm the following code display the correct RadComboBox:




    telerik:RadComboBox telerik:StyleManager.Theme="Windows7" HorizontalAlignment="Left"




    Name="RadComboBoxCountry" VerticalAlignment="Top" Width="245"





    Margin="3" MaxHeight="35" SelectedIndex="0"





    ItemsSource="{Binding ElementName=CountryDataSource, Path=Data}"




    SelectedValue ="{Binding supp_country, Mode=TwoWay}"




    SelectedValuePath="country_idno" SelectionChanged="CountryCombo_Changed"











    However, I am not able to display the correct SelectedValue from the record that I searched. Please see italics code.

    Then, when I placed the same code inside a DataForm where successfully accessed the result of my searching.  The RadComboBox doesnt even display anything.

    I am using VB.Net 2010 with a RadControls for Silverlight Q2 2010 SP2.

    Also here is how I access my DataSource:




    <!--Table Suppliers DataSource-->





    <riaControls:DomainDataSource Name="SuppliersDataSource" LoadSize="20" QueryName="GetTbl_supplier">

























    <riaControls:SortDescriptor PropertyPath="supp_idno" Direction="Ascending"/>















    <riaControls:FilterDescriptor PropertyPath="supp_idno"












    Value="{Binding ElementName= suppIDNoText, Path= Text}">




















    <!--Table Country DataSource-->





    <riaControls:DomainDataSource Name="CountryDataSource" AutoLoad="True" QueryName="GetTbl_country">

























    <riaControls:SortDescriptor PropertyPath="country_idno" Direction="Ascending"/>












    Here's the code for the DataForm:




    <dataForm:DataField Label="Country 2: ">





    <!--<TextBox Text="{Binding supp_country, Mode=TwoWay}" />-->





    <telerik:RadComboBox Grid.Column="1" Grid.Row="4" HorizontalAlignment="Left"





    ItemsSource="{Binding ElementName=CountrysDataSource, Path=Data}" Margin="3" Name="Supp_countryRadComboBox"





    VerticalAlignment="Center" Width="150" SelectedValuePath="country_idno" DisplayMemberPath="country_desc"




    SelectedValue ="{Binding supp_country, Mode=TwoWay}">










    <TextBlock Text="{Binding country_desc}"/>















    Can any one help me with my problem.  I've been looking for a solution for the whole day already and wasn't able to implement some of those codes that I saw. 

    Thanks in advance SL Gurus...


  2. George
    George avatar
    1332 posts

    Posted 21 Feb 2011 Link to this post

    Hello Almond,

    Please, make sure your bindings are correct. Fortunately, we have an example for RadComboBox in a DataForm. Attached you can find the project.

    I hope this helps.

    All the best,
    the Telerik team
  3. Almond
    Almond avatar
    43 posts
    Member since:
    Feb 2011

    Posted 21 Feb 2011 Link to this post

    Much thanks George,

    We'll give you a feedback once I have tested the attached file.

    Thanks again

Back to Top