Can Lookupedit add and remove each item ?
I think we need a bit more context to answer your question?
I add each Item (record) into Lookupedit but an error
// Open connection database
Cnn.ConnectSQL();
SqlDataAdapter da = new SqlDataAdapter("SELECT TabSTAFF.IDSTAFF, TabSTAFF.NAMESTAFF FROM TabSTAFF ORDER BY TabSTAFF.IDSTAFF;", Cnn.objConnect);
DataSet ds = new DataSet();
DataTable dt = new DataTable();
da.Fill(ds, "TabSTAFF");
dt = ds.Tables["TabSTAFF"];
kpNhanvien.EditValue = dt.Rows[0]["NAMESTAFF"].ToString();
foreach (DataRow dr in dt.Rows)
{
/ / Get an error immediately below this line
lkpNhanvien.Properties.Columns.Add(new LookUpColumnInfo(dr["IDSTAFF"].ToString(), dr["NAMESTAFF"].ToString()));
}
//lkpQuyensd.Properties.DataSource = dt;
lkpNhanvien.Properties.DisplayMember = "NameStaff";
lkpNhanvien.Properties.ValueMember = "IDstaff";
And I want to remove each item in Lookupedit ? how to write code looupedit ?
Copyright (c) Marimer LLC