problem with combobox which get's data from database

3 posts, 1 answers
  1. Richard Koslik
    Richard Koslik avatar
    71 posts
    Member since:
    Apr 2010

    Posted 15 Oct 2010 Link to this post


    My situation is the following.
    I have a table BP where I have a field BP_S_GENDERCODE. Now I want to create in Silverlight a combobox which shows the data from a table GENDER. When I selected an item, the value GENDER_S_NR from the GENDER table should then be written into the field BP_S_GENDERCODE and also the way back.

    My question is now, is this possible and when yes ... how it works.

    I tried the following:

    <telerik:RadComboBox x:Name="cbBP_S_GENDERCODE" Width="200" Height="28" Margin="0 5 0 0"
                         ItemsSource="{Binding tab_GENDERs}"
                         SelectedItem="{Binding SelectedBPItem.BP_S_GENDERCODE, Mode=TwoWay}"
                         HorizontalAlignment="Left"  />

    tab_GENDERs  => Binding to the table GENDER
    SelectedBPItem => my selected item from the BP table, which I want to change
    BP_S_GENDERCODE => field of the BP table, which I want to change
    GENDER_S_NR => field which is used to show the right item in the combobox
    GENDER_I_TXT_TAG => Field from the table GENDER which I want to display for the user in the combobox

    It works now a little bit, but not so that I can use it. I have the following problems:

    - If I select an item from the combobox it is not shown at the first time, when I select it a second time than it is shown???
    - If I change between my customers from the BP table there is no change in the displayed value of the combobox
    - If I select an item (GENDER_S_NR=2) from the combobox it writes the value "GENDER : 2" into my field BP_S_GENDERCODE, but I only need the value "2"!?!

    Are there problems with using a combobox on this way or have I configured something false?

    I hope you can help!

    Best Regards,
  2. Answer
    George avatar
    1332 posts

    Posted 21 Oct 2010 Link to this post

    Hi Richard,

    Thank you for contacting us.

    I try to reproduce your scenario in a custom sample. Attached you can find the project. Let me know if this suits your needs. 

    I will be glad to assist you further. 

    Sincerely yours,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Richard Koslik
    Richard Koslik avatar
    71 posts
    Member since:
    Apr 2010

    Posted 21 Oct 2010 Link to this post

    Hello, thank's it works now! The example helped me to understand and use the right properties of the combobox.

    Regards, Richard
Back to Top