I am working on web app with data base (SQL server). I made my multiple drop down list and now what I need is when I select one value from it to show only first column.
Something like this:
id , Text
31231 dadsadsa
32131 dsadsads
54345 dasdadsd
53455 trretrer
When I select the first row 31231 dadsadsa
, I want to appear only the id of it (31231
).
I use this to bind these two columns
for (int i = 0; i < dt.Rows.Count; i++)
{
id = dt.Rows[i]["first_c"].ToString();
name = dt.Rows[i]["second_c"].ToString();
newName = id + " ---- " + name;
DropDownList1.Items.Add(new ListItem(newName, id));
}
I hope you guys understand me.