I have a listbox named lbselectedcom in my web page. and i am binding some data to this list box by using a data table. this datatable named dt have 3 fields -name,ID,Score
lbSelectedCom.DataTextField = "Name";
lbSelectedCom.DataValueField = "ID";
lbSelectedCom.DataSource = dt.DefaultView;
lbSelectedCom.DataBind();
It works fine.Now i want to get score of the corresponding name with their ID. ID will get easily by using selected value property. Is there any way to bind Score field like ID in datavaluefield?? So that i can easily access score of each selected item like accessing ID by using selected value property
You can add a new column to your datatable. And set the value of that column to be concatenation of ID and score separated by some delimiter.
http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression(VS.71).aspx