RadCombobox Selected Value empty

4 posts, 0 answers
  1. Eric Bradley
    Eric Bradley avatar
    5 posts
    Member since:
    Apr 2006

    Posted 24 Apr 2013 Link to this post

    Hi, We've upgraded our application from RadControls ASP.net Q3 2012 to Q1 2013. We now have a problem with SelectedValue when binding data to the radCombobox. For some reason the SelectedValue isn't set to the first item added. It works fine using Q3 2012 so wondering if you've heard issues.

    This issue is what we are experiencing

    http://www.telerik.com/support/pits.aspx#/details/Issue=2147

    Thanks
    Eric

  2. Plamen
    Admin
    Plamen avatar
    2969 posts

    Posted 29 Apr 2013 Link to this post

    Hello Eric,

     
    I have inspect eh the scenario you described but could not observe the unusual behavior. Would you please share the exact code that you use that works fine with Q3 2012 and does not work with Q1 2013 so we could inspect it and be more helpful?

    Regards,
    Plamen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Eric Bradley
    Eric Bradley avatar
    5 posts
    Member since:
    Apr 2006

    Posted 30 Apr 2013 Link to this post

    Hi Plamen, Here is the code that we are using. The error is raised at this line "if (int.Parse(rcbStageId.SelectedValue) == 4. For some reason the first record added to rcbStageId isn't set as the selectedValue.

    Thanks for your help

    <telerik:RadComboBox ID="rcbStageId" runat="server" MarkFirstMatch="True"
        Width="135px" MaxHeight="200px"  AutoPostBack="True"
        meta:resourcekey="rcbStageIdResource1"
        onselectedindexchanged="rcbStageId_SelectedIndexChanged">
       <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
    </telerik:RadComboBox>
     
     
    protected void Rebind_rcbStageId()
            {
                P3StageCollection items = new P3StageCollection();
                // items to fetch is the total number of items displayed currently, plus
                // the amount requested each fetch
                IPredicateExpression filter = new PredicateExpression();
                ISortExpression sorter = new SD.LLBLGen.Pro.ORMSupportClasses.SortExpression();
                if (LanguageSelected == BaseLanguage.LanguageType.English)
                    sorter.Add(P3StageFields.DescEn | SortOperator.Ascending);
                else
                    sorter.Add(P3StageFields.DescFr | SortOperator.Ascending);
     
                IRelationCollection relations = new RelationCollection();
     
                items.GetMulti(filter, 1000, sorter, relations);
                string value = rcbStageId.SelectedValue;
                rcbStageId.Items.Clear();
                if (P3ProjectFields.StageId.IsNullable)
                {
                    RadComboBoxItem rcbItem = new RadComboBoxItem("", "");
                    rcbStageId.Items.Add(rcbItem);
                }
                foreach (P3StageEntity item in items)
                {
                    if (LanguageSelected == BaseLanguage.LanguageType.English)
                    {
                        RadComboBoxItem rcbItem = new RadComboBoxItem(item.DescEn.ToString(), item.StageId.ToString());
                        rcbStageId.Items.Add(rcbItem);
                    }
                    else
                    {
                        RadComboBoxItem rcbItem = new RadComboBoxItem(item.DescFr.ToString(), item.StageId.ToString());
                        rcbStageId.Items.Add(rcbItem);
                    }
                }
                if (value != "")
                {
                    rcbStageId.SelectedValue = value;
                }
                if (int.Parse(rcbStageId.SelectedValue) == 4)
                {
                    dtActualEndDate.Enabled = true;
                    lbl_dtActualEndDate.Enabled = true;
                }
            }
  4. Plamen
    Admin
    Plamen avatar
    2969 posts

    Posted 03 May 2013 Link to this post

    Hello Eric,

     
    Thank you for contacting us again and providing the code used.

    I have isolated the issue to a sample web page with only a RadComboBox and a Button which is adding an item in it. Unfortunately could not observe any difference in the behavior between the two versions of RadControls.

    I am attaching my sample test project. Please review it and let me know if I have to add something else to be able to observe the described issue and be able to help you.

    Greetings,
    Plamen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top