Hi i want to add the particular field in dropdownlist by coding so hows that's possible
views:
21answers:
2
+1
A:
not sure from your question, but I think you are looking for...
ListItem li = new ListItem();
li.Text = "yourtext";
li.Value = "yourvalue";
li.Selected = true;
yourDropdown.Items.Add(li);
Muhammad Akhtar
2010-02-05 04:54:15
A:
if you mean a new item in drop-down list then use this:
ddList.Items.Add("Your New Item");
if you are using databinding with datatable having following fields:
Name, Age, ID
then use this
dataTable.Rows.InsertAt(0,new object[]{"[Select]",0,-1});
TheVillageIdiot
2010-02-05 04:56:16