When I choose something in lstCodes, I lookup the value in a datatable dtCategoryLookup, then I populate lstSelected's datasource with a new row containing the id and description of the lookup.
lstSelected is to a datatable dtSelected.
When I run the code below, the only thing added to lstSelected is the string "System.Data.DataRowView"
DataRow[] dr = dtCategoryLookup.Select("id='"+lstCodes.SelectedValue.ToString().Trim()+"'");
DataRow oRow = dtSelected.NewRow();
oRow["id"]=(
oRow["cDescription"]=(string)dr[0]["cDescription"];
dtSelected.Rows.Add(oRow);
Any ideas

listbox bound to a datatable
MStrange
yes the DisplayMember is set to "cDescription" and ValueMember is set to "id"
in the Load of the form:
dtSelected = new DataTable();
new object[] {"A","B"});dtSelected.Columns.Add("id");
dtSelected.Columns.Add("cdescription");
lstSelected.DisplayMember="cDescription";
lstSelected.ValueMember="id";
lstSelected.DataSource=dtSelected;
dtSelected.Rows.Add(
spinu
At the end of your code you need to call DataBind() of the listbox.
Kieme Ile