RadComboBox pushing null to SelectedItem/SelectedValue upon load

14 posts, 0 answers
  1. yonadav
    yonadav avatar
    60 posts
    Member since:
    Oct 2009

    Posted 04 Feb 2010 Link to this post

    Hi All,

    This is another issue we've started encountering only after the move to Q3 SP2 2009 (we were at Q3 2009 yesterday).

    If, for example, we've defined a RadComboBox like so:
    <telerik:RadComboBox SelectedValue="{Binding Setting}" 
                                      ItemsSource="{Binding PossibleValues,Mode=OneWay}" 
                                      SelectedValuePath="UniqueName" 
                                      DisplayMemberPath="FriendlyName" /> 

    And we place a breakpoint in the Setting property's set function (noticed its bound to SelectedValue). Then every time the RadComboBox we get a call to set with a value of null. Similar things happen when binding to SelectedItem.

    Oddly enough, we did not have this issue in Q3 2009 (re-tested today).

    Any ideas?

    Thanks,
    yonadav
  2. Tony Mocella
    Tony Mocella avatar
    9 posts
    Member since:
    Jan 2010

    Posted 25 Feb 2010 Link to this post

    We've noticed the same behavior in our project (also using 2009 Q3 SP2). Is this something that is fixed in the 2010 Q1 release?
  3. UI for WPF is Visual Studio 2017 Ready
  4. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 27 Feb 2010 Link to this post

    Hello Tony,

    Could you open a new support ticket and send me a simple application that could be used to observe the problem? We will do our best to provide a fix by Q1 2010, that is scheduled in a couple of weeks.

    Sincerely yours,
    Valeri Hristov
    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.
  5. yonadav
    yonadav avatar
    60 posts
    Member since:
    Oct 2009

    Posted 09 Mar 2010 Link to this post

    Hi Tony,

    In the meantime, you can do what we did:

    We set up a between the combo box's Tag property  to the value in a OneTime mode, such as:

    <telerik:RadComboBox ... Tag="{Binding Something,Mode=OneTime}" />

    This saves the inital value there. Then, we hook the combo box's Loaded Event where we copy the value from the Tag to the SelectedValue (or SelectedItem, depending on the case).

    HTH,
    yonadav
  6. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 10 Mar 2010 Link to this post

    Hi,

    Did you place RadComboBox inside a RadGridView CellEditTemplate? If you did, the problem is known and will be fixed in the near future. If you didn't a sample application demonstrating the problem would be of great help.

    All the best,
    Valeri Hristov
    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.
  7. Tony Mocella
    Tony Mocella avatar
    9 posts
    Member since:
    Jan 2010

    Posted 10 Mar 2010 Link to this post

    I think the issue in our case was our EntityFramework classes nullifying the values in our objects when the selected-items get changed via a bound-element on the screen.  We'll work through that issue and circle back if we are still having problems.

    Thanks for the pointers.
  8. yonadav
    yonadav avatar
    60 posts
    Member since:
    Oct 2009

    Posted 10 Mar 2010 Link to this post

    Hi Valeri,

    We've placed it within an editor template of the MindScape WPF Property Grid. I have a feeling it has a similar behavior to the CellEditTemplate...

    When will this be corrected?

    Thanks,
    yonadav
  9. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 15 Mar 2010 Link to this post

    Hi yonadav,

    The problem comes from the fact that when RadComboBox.ItemsSource is changed (in this case with null) combo box changes its selected index (value) and through binding updates underlying data object (also with null). I think that this is an expected behavior of the RadComboBox.
    In our case (RadGridView and CellEditTemplate) the grid control sets RadComboBox.DataContext to null when cell edit is ended which causes the problem.

    We've already fixed the issue and fix will be available with the next latest internal build (every Friday).

    Unfortunately the fix is within RadGridView domain. So I think that this won't fix your scenario with "MindScape WPF Property Grid".

    Don't hesitate to contact us if you have other questions.


    All the best,
    Nedyalko Nikolov
    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.
  10. Simon
    Simon avatar
    47 posts
    Member since:
    May 2008

    Posted 26 Jul 2011 Link to this post

    We're experiencing the same problem with the latest controls (Version 2011.2.712.1040).
    The RadComboBox's SelectedItem is bound to a property on the ViewModel.
    However the property on load is being set to Null by the RadComboBox.

    Our RadComboBox sits within a ControlTemplate....
    <ControlTemplate x:Key="EditAppointmentTemplate"
              TargetType="TelerikSchedule:SchedulerDialog">

    ...and the RadComboBox sits within a Grid.

    When we replace the RadComboBox with a normal ComboBox control - the problem goes away.
    Is there a fix for this - we really would like to keep using the Telerik RadComboBox.

    Thanks

    EDIT----Further to this...
    If I open my EditAppointmentTemplate every alternate time it works. I do not select another appointment in between this.
    So
    Open 1st time  - RadComboBox sets the property to nulll.
    Open 2nd time   - RadComboBox gets the property correctly - based on RIA value
    Open 3rd time -  - RadComboBox sets the property to nulll.
    Open 4th time -   - RadComboBox sets the property correctly - base on RIA value
    etc etc


  11. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 27 Jul 2011 Link to this post

    Hello Simon,

    I would need a sample application in order to provide specific advice. I suppose this thread is about different problem...

    Kind regards,
    Valeri Hristov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  12. YYZRichard
    YYZRichard avatar
    20 posts
    Member since:
    Dec 2009

    Posted 30 Jan 2012 Link to this post

    Is there any fix schedule for this problem?
    I've got the latest version (as of Jan-2012) and I'm still having the same problem.
    I cannot set the the selected item.

    The combobox is populated successfully, and the properties "SelectedValuePath" and "DisplayValuePath" are pointing to the correct fields.
    When I set the value to...
    MyRadComboBox.SelectedValue = "2";
    ... it's still showing as null, eventhough the item exists in the combobox.

  13. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 03 Feb 2012 Link to this post

    Hello Richard,

    Could you please, send us a simple application that demonstrates the problem? We never received similar feedback as you describe your problem, so I think it would be best to investigate an application in order to determine if this is a bug in RadComboBox, or in your application.

    Greetings,
    Valeri Hristov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  14. Ron
    Ron avatar
    1 posts
    Member since:
    Oct 2012

    Posted 18 Oct 2012 Link to this post

    I found a work around that may or may not apply to your situation.  I ran into what looks like the same issue.  I made sure my SelectedValuePath and DisplayValuePath are set correctly.  The combo box is filled with the correct objects and values.  But, If I try to do a two-way binding to the SelectedValue property, a null value is passed by the control and sets the value of the target object to null.  

    What I did was create a command that sets the value and passes a commandParameter to the command.  I use the command to set the value of the desired property and use OneWay binding on the SelectedValue to display the selected object in the comboBox.

    <telerik:RadComboBox x:Name="rcbLevel1" d:LayoutOverrides="Height" ItemsSource="{Binding InsertEditItem.Level1s, Mode=TwoWay}" SelectedValue="{Binding InsertEditItem.CurrentItem.Level1}"
                                    SelectedValuePath="Description" EmptyText="Select a category..." IsEnabled="{Binding InsertEditItem.Level1IsEnabled, Mode=TwoWay}" Command="{Binding InsertEditItem.SetActiveLevel1Command, Mode=OneWay}" CommandParameter="{Binding SelectedItem, ElementName=rcbLevel1}" DisplayMemberPath="Description"  IsEditable="True"/>
  15. Cedric
    Cedric avatar
    1 posts
    Member since:
    Dec 2012

    Posted 08 Oct 2013 Link to this post

    Actually I found this

    It appears the issue is coming from wpf Combobox control (which is extended by the radcombobox I suspect) and  you need to do your updates for the selected item BEFORE the itemsource update in you ViewModel file (I know it sounds crazy but it worked for me).
Back to Top
UI for WPF is Visual Studio 2017 Ready