public void DataBind()
        {
            uc_RoomStatusItem[] Item;
            Item = new uc_RoomStatusItem[Datasource.Count];
            flowLayoutPanel1.Controls.Clear();

            for (int i = 0; i < Datasource.Count; i++)
            {
                //---------------------------------------------
                // Process when display in past
                if (this.StatusButtonPopup == 1) // qua khu / past
                {
                    if (this.Datasource[i].RoomStatus == 0 && this.Datasource[i].CheckInActual <= CheckTime && CheckTime <= this.Datasource[i].CheckOutActual )
                    {
                        this.Datasource[i].RoomStatus = 3;
                    }
                }
                //---------------------------------------------
                Item[i] = new uc_RoomStatusItem(this.Datasource[i]);
                Item[i].Visible = true;
                Item[i].StatusButtonPopup = this.StatusButtonPopup;
                flowLayoutPanel1.Controls.Add(Item[i]);

            }
        }
        //------------------------------------------------------------------------------
        public void DataBind()
        {
            uc_RoomStatusItem[] aListRoom;
            var maxLevelSkuTemp = Datasource.Max(b => b.LevelSku);
            int maxLevelSku = int.Parse(maxLevelSkuTemp.ToString());

            aListRoom = new uc_RoomStatusItem[Datasource.Count];
            this.FlowLayoutPanel_Load(maxLevelSku);

            for (int i = 0; i < Datasource.Count; i++) {
                //---------------------------------------------
                // Process when display in past
                if (this.StatusButtonPopup == 1) // qua khu / past
                {
                    if (this.Datasource[i].RoomStatus == 0 && this.Datasource[i].CheckInActual <= CheckTime && CheckTime <= this.Datasource[i].CheckOutActual) {
                        this.Datasource[i].RoomStatus = 3;
                    }
                }
                aListRoom[i] = new uc_RoomStatusItem(this.Datasource[i]);
                aListRoom[i].Visible = true;
                aListRoom[i].StatusButtonPopup = this.StatusButtonPopup;
            }
            for (int i = 1; i <= maxLevelSku; i++) {
                NavBarGroup aNavBarGroup = new NavBarGroup();
                aNavBarGroup.Caption = "Tầng " + i;
                aNavBarGroup.Name = "navBarGroup" + i;

                aNavBarGroup.GroupStyle = DevExpress.XtraNavBar.NavBarGroupStyle.ControlContainer;
                aNavBarGroup.Expanded = true;
                AddFloor(aNavBarGroup, i, aListRoom);

            }
        }
        private void AddFloor(NavBarGroup aNavBarGroup, int LevelSku, uc_RoomStatusItem[] aListRoom)
        {
            NavBarGroupControlContainer aNavBarGroupControlContainer = new NavBarGroupControlContainer();
            aNavBarGroupControlContainer.Name = "navBarGroupControlContainer" + LevelSku;
            //aNavBarGroupControlContainer.Size =  new System.Drawing.Size(865, 300);
            aNavBarGroupControlContainer.TabIndex = 0;
            aNavBarGroupControlContainer.Height = 500;

            aNavBarGroup.ControlContainer = aNavBarGroupControlContainer;
            aNavBarGroup.GroupClientHeight = 370;

            aNavBarGroupControlContainer.Controls.Add(aListFlowLayoutPanel[LevelSku - 1]);

            this.navBarControl1.Controls.Add(aNavBarGroupControlContainer);
            this.navBarControl1.Groups.Add(aNavBarGroup);

            this.AddRoom(aListFlowLayoutPanel[LevelSku - 1], LevelSku, aListRoom);

            aNavBarGroupControlContainer.Dock = DockStyle.Fill;
            aNavBarGroupControlContainer.AutoSize = true;

            //aNavBarGroupControlContainer.AutoSizeMode = AutoSizeMode.GrowAndShrink;

            aListFlowLayoutPanel[LevelSku - 1].Dock = DockStyle.Fill;
            aListFlowLayoutPanel[LevelSku - 1].AutoSize = true;
            aListFlowLayoutPanel[LevelSku - 1].AutoSizeMode = AutoSizeMode.GrowAndShrink;
        }
 private void AddRoom(FlowLayoutPanel aFlowLayoutPanel, int LevelSku, uc_RoomStatusItem[] aListRoom)
 {
     //aFlowLayoutPanel.Controls.Clear();
     for (int i = 0; i < aListRoom.Count(); i++) {
         if (aListRoom[i].Datasource.LevelSku == LevelSku) {
             aFlowLayoutPanel.Controls.Add(aListRoom[i]);
         }
     }
 }
        public void FlowLayoutPanel_Refesh()
        {
            uc_RoomStatusItem[] aListRoom;
            var maxLevelSkuTemp = Datasource.Max(b => b.LevelSku);
            int maxLevelSku = int.Parse(maxLevelSkuTemp.ToString());

            aListRoom = new uc_RoomStatusItem[Datasource.Count];

            for(int i = 0; i < Datasource.Count; i++) {
                //---------------------------------------------
                // Process when display in past
                if(this.StatusButtonPopup == 1) // qua khu / past
                {
                    if(this.Datasource[i].RoomStatus == 0 && this.Datasource[i].CheckInActual <= CheckTime && CheckTime <= this.Datasource[i].CheckOutActual) {
                        this.Datasource[i].RoomStatus = 3;
                    }
                }
                aListRoom[i] = new uc_RoomStatusItem(this.Datasource[i]);
                aListRoom[i].Visible = true;
                aListRoom[i].StatusButtonPopup = this.StatusButtonPopup;
            }
            for(int i = 1; i <= maxLevelSku; i++) {
                aListFlowLayoutPanel[i - 1].Controls.Clear();
                this.AddRoom(aListFlowLayoutPanel[i - 1], i, aListRoom);
            }
        }