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

[Solved] Adding new item to beginning of bound list

1 Answer 100 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Craig Smith
Top achievements
Rank 1
Craig Smith asked on 01 Oct 2009, 05:00 PM
froms = new string[] { "Craig""Lowell""Richard" }; 
rcbFromFilter.DataSource = froms; 
rcbFromFilter.DataBind(); 
rcbFromFilter.Items.Add(new RadComboBoxItem("All""-1")); 

Using the above code the "All" option is added to the bottom of the list. I need it at the top. I realize I could put it into the array but I will be binding to a database table so that isn't an option.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 02 Oct 2009, 08:24 AM
Hello,

Please try the following:

aspx:
<telerik:RadComboBox  
     id="RadComboBox1"  
     runat="server"  
     AppendDataBoundItems="True"
</telerik:RadComboBox> 

cs:
string[] froms = new string[] { "Craig", "Lowell", "Richard" }; 
RadComboBox1.DataSource = froms
RadComboBox1.Items.Add(new RadComboBoxItem("All", "-1")); 
RadComboBox1.DataBind(); 


Regards,
Helen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
Craig Smith
Top achievements
Rank 1
Answers by
Helen
Telerik team
Share this question
or