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

RadComboBox LoadOnDemand Items Null

3 Answers 145 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Rob Schieber
Top achievements
Rank 1
Rob Schieber asked on 30 Jun 2008, 04:16 PM
I'm using Version 2008.1.415.20 of RadComboBox.  After a postback when using the LoadOnDemand=true to fetch the items, the Items collection is null.  

The SelectedValue field seems to be populating with the text value in the combo box.  Unfortunately, I need the value of what the DataValue field was, and not the DataTextField. 

Any help here would be appreciated.  Thanks.

3 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 01 Jul 2008, 07:06 AM
Hi Rob,

The Items collection is not persisited on the server by design if the items are laoded on demand. However SelectedValue and Text property should returns correct values. I suggest you try our latest official release 2008.1.619. You can download it from your account.

Also,please see our online example. It works as expected at our side.

If this does not help you,please open a support ticket and send us sample running project to test it locally.

Regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Rob Schieber
Top achievements
Rank 1
answered on 01 Jul 2008, 06:32 PM
It is difficult to tell if its working as expected.  In the example you posted, you set datavalue and datatext to the same value, so on the post back its impossible to tell if there is a problem:

                    RadComboBox1.Items.Add(new RadComboBoxItem(data.Rows[i]["CompanyName"].ToString(), data.Rows[i]["CompanyName"].ToString() )); 

Here is what I want,

                    RadComboBox1.Items.Add(new RadComboBoxItem(data.Rows[i]["CompanyName"].ToString(), data.Rows[i]["CompanyID"].ToString() )); 

When I do this in my code, I expect to see CompanyID as the value, instead I see CompanyName.
0
Rosi
Telerik team
answered on 02 Jul 2008, 12:14 PM
Hello Rob ,

Please find the attached project illustrating how this works at our side. You can download it and review it.

Hope this helps.

Regards,
Rosi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Rob Schieber
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Rob Schieber
Top achievements
Rank 1
Share this question
or