This is a migrated thread and some comments may be shown as answers.

RadComboBox Error

1 Answer 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
leaders
Top achievements
Rank 1
leaders asked on 18 Mar 2012, 05:00 PM
Hi All,

I'm using combobox in usercontrol data is bind from database through LoadCombo() method if I place this method in if (!ispostback) nothing is load out that it load data , and using this usercontrol in main page in RadTabStrip at first when I select the value and click submit button every things works fine then if I click combox for next selection I get this error :Selection out of range
Parameter name: value

Methods :

 private void LoadCombo()
    {
        DataSet _objDS = new DataSet();
        DataSet _objDSCard = new DataSet();
        _objDS = _objBlGeneral.fn_EmpId_No_Card_Get(0);
        rcbEmpId.DataSource = _objDS;
        rcbEmpId.DataTextField = "Emp_Name";
        rcbEmpId.DataValueField = "EmpId";
        rcbEmpId.DataBind();
        _objDSCard = _objBlGeneral.fn_CardId_Ready_Get();
        rcbCardId.Items.Clear();
        rcbCardId.DataSource = _objDSCard;
        rcbCardId.DataTextField = "CatId";
        rcbCardId.DataValueField = "CatId";
        rcbCardId.DataBind();
    }

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            GetData();
           
        }


        LoadCombo();
       
    }

One more query How can I Flush data of combobox before loading the data like first time binding the data again.
Thanks

1 Answer, 1 is accepted

Sort by
0
Ivana
Telerik team
answered on 21 Mar 2012, 03:12 PM
Hello,

I am not sure I understand your scenario well. I have, however, prepared a sample project which  demonstrates a user control with a RadComboBox in it, inside a RadPageView.
You could download it and take a look at it locally.

Let me know if this helps.

Regards,
Ivana
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.
Tags
General Discussions
Asked by
leaders
Top achievements
Rank 1
Answers by
Ivana
Telerik team
Share this question
or