RadComboBoxItem.Selected does not set RadComboBoxText

7 posts, 0 answers
  1. Dave
    Dave avatar
    13 posts
    Member since:
    Jun 2011

    Posted 11 Jul 2011 Link to this post

    In the Page.PrerenderComplete event for !IsPostBack, I find a RadComboBoxItem and set the Selected property but the Text in the RadComboBox does not change. I can also set the RadComboBox.SelectedItemIndex and that still does not work. When the ComboBox renders, the old text is still there but when I do the drop down I see the item I selected using either method. I have degugged the control and see the properties I am setting Ok but never see the Text property change. The initial data load is bound to a SqlDataSource within the UC.

    Shouldn't the ComboBox.Text follow the setting of either of these properties?

    Also, this is inside of a user control on a page and it seems there have been others with the problem when inside a uc. I have another just in a regular page but not a UC and it works fine as expected.

    Thanks, Dave
  2. Dave
    Dave avatar
    13 posts
    Member since:
    Jun 2011

    Posted 12 Jul 2011 Link to this post

    Anyone have suggestions on how to get this to work in a UC?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dave
    Dave avatar
    13 posts
    Member since:
    Jun 2011

    Posted 13 Jul 2011 Link to this post

    Telerik - do you offer any support here? There are several complaints about this? Do you know this works or does not work? Please post something...hopefully a sample proving it works or not.
  5. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 14 Jul 2011 Link to this post

    Hi Dave,

    The reason for the experienced behavior is due to the fact that you are trying to change the selected item too late during page life cycle. If you want to preselect a particular item, you should do this in Page_Load or Page_PreRender event.

    Regards,
    Dimitar Terziev
    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!

  6. Dave
    Dave avatar
    13 posts
    Member since:
    Jun 2011

    Posted 14 Jul 2011 Link to this post

    Thanks Dimitar. I did try Page_Load but the control is databound to an EntityDataSource and was not yet populated. Should the combobox items be loaded if databound during page_load?
  7. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 18 Jul 2011 Link to this post

    Hello Dave,

    Have you tried setting the SelectedIndex in Page_PreRender event?

    Regarding your questing when to bind the RadCombobox, yes it's preferable to use the Page_Load event.

    Kind regards,
    Dimitar Terziev
    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!

  8. Linta Sheel
    Linta Sheel avatar
    1 posts
    Member since:
    Sep 2015

    Posted 23 Oct 2015 Link to this post

    I'm also getting the same error.

    I'm dping the radcombobox.selectedvalue="value" in my page load.

     I can see the value selected when I click on the dropdown but not when the page is displayed.

     Pls Help..

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017