//load room private void LoadRoomByDelFlag(int p) { RoomInfoBLL bll = new RoomInfoBLL(); dgvRoomInfo.AutoGenerateColumns = false; ; dgvRoomInfo.DataSource = bll.GetAllRoomInfoByDelFlag(p); dgvRoomInfo.SelectedRows[0].Selected = false; }
private void LoadRoomInfoByDelFlag(int p) { RoomInfoBLL bll = new RoomInfoBLL(); List<RoomInfo> listRoom = bll.GetAllRoomInfoByDelFlag(p); for(int i=0; i<listRoom.Count; i++) { // tab object TabPage tp = new TabPage(); // display room name tp.Text = listRoom[i].RoomName; // roomInfo object store in tag property tp.Tag = listRoom[i]; // listview object ListView lv = new ListView(); // bind image lv.LargeImageList = imageList1; // picture show style lv.View = View.LargeIcon; // fill to listview lv.Dock = DockStyle.Fill; // listview background color lv.BackColor = Color.Green; // multiselect lv.MultiSelect = false; tp.Controls.Add(lv); tabControl1.TabPages.Add(tp); } }