Hello All,
i am filling country list to Combobox.
This list comes from Database.
now I want to Insert "--Select--" at the top of combox.
i tried cmbcountry.items.insert(0,"--Select--");
but it fired exception that items collections can not be modified after datasource property is set.
Can anyone help me to sort out this problem
Thank in advance
Azamat
How to insert "--Select--" in combobox
6 Answers
Know the answer? Post it. Somebody with the same question will find it here.
milind khire33 pointsPosted Oct 3, 2006, 5:18 AM EDT
Azamat3 pointsPosted Oct 4, 2006, 8:00 PM EDT
But as i wrote in my post it thorws exception Items collection can not be modified after data source property is set
And also i cant find any object like ListItem, so i didnt use it at all.
thanks again
jc mandapat16 pointsPosted Oct 8, 2006, 1:44 AM EDT
mohitchawla4 pointsPosted Oct 9, 2006, 5:15 AM EDT
this works for sure.
"(select convert(nvarchar, '(Select)') as \"field1\") union all (select field1 from table1)"
saravanan gajendran23 pointsPosted Oct 10, 2006, 11:05 PM EDT
saravanan gajendran23 pointsPosted Oct 10, 2006, 11:06 PM EDT