RadDropDownList通过数据表或List <string>绑定,根据RadDropDownList的值/项目填充文本框

时间:2018-06-20 01:33:59

标签: c# winforms

课程清单

public class doc
    {
        public string NAME { get; set; }
        public int CODE { get; set; }
        public string ROOM { get; set; }
    }

//另一个用于绑定的选项

Datatable dt = dt.Source
List<string> a = dt.AsEnumerable().Select(dr => dr["FIELD"].ToString()).ToList<string>();
listbox1.Items.AddRange(a);

var a = bill.GetDocs();//List source
DataSet ds = bill.GetDoctors();//Datasetsource
dlNAME.DataSource = a;
dlNAME.ValueMember = "ROOM";
dlNAME.DisplayMember = "NAME";
enter code here

//两个绑定源都在列表框中。

private void SelectedIndexChanged
{
txtbox1.Text = //What code should I put?
}

0 个答案:

没有答案