7
Answers

About C# Corner

Suthish Nair

Suthish Nair

14y
8.3k
1

Hi All,

I luckly visited some websites which having some intresting informations About C# Corner. :)

Sure you all like this.

Dont miss Link 3.

Link1
Link2
Link3
Answers (7)
0
Amit Gupta
NA 16.5k 25.7k 9y
Hi Anil.
You are not allowed to insert items when you use bind function.

If you want to add items to dropdown liat dynamically... u can add rows to dropdown item source table...

It will automatically shows your nesly insrted item.
0
anil wagavkar
NA 13 2.9k 9y
as per ur suggestion i change code but error is come
0
Amit Singh
NA 3.7k 46.7k 9y
Hey,
 
This will be the order of binding dropdownlist
 
DropDownList2.DataTextField = "name";
DropDownList2.DataValueField = "rankcode";
DropDownList2.DataSource = dt; 
DropDownList2.DataBind();
DropDownList2.Items.Insert(0, new ListItem("------Select Salemans---------", "0"));
 
 
 
Note: Datasource will be always after DataTextField and DataValueField