Ejemplo n.º 1
0
        private void RoomGrid_Initialize()
        {
            Helper.DataGridHelper.Layouts(RoomDataView, Color.Azure, Color.Wheat, Color.Tan, false, Color.Sienna, false, false, false);

            //Set Height,width and add panel to your selected control
            Helper.DataGridHelper.GenerateDataGrid(RoomDataView, pnlDashBoard, 800, 200, 10, 10);

            // BoundColumn creation
            Helper.DataGridHelper.Templatecolumn(RoomDataView, Helper.DataGridHelper.FormControls.BoundColumn, "GuestName", "GuestName", "GuestName", true, 90, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleCenter, DataGridViewContentAlignment.MiddleRight, Color.Transparent, null, "", "", Color.Black);

            // BoundColumn creation
            Helper.DataGridHelper.Templatecolumn(RoomDataView, Helper.DataGridHelper.FormControls.BoundColumn, "Age", "Age", "Age", true, 90, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleCenter, DataGridViewContentAlignment.MiddleRight, Color.Transparent, null, "", "", Color.Black);
            // BoundColumn creation
            Helper.DataGridHelper.Templatecolumn(RoomDataView, Helper.DataGridHelper.FormControls.BoundColumn, "Sex", "Sex", "Sex", true, 90, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleCenter, DataGridViewContentAlignment.MiddleRight, Color.Transparent, null, "", "", Color.Black);
            // BoundColumn creation
            Helper.DataGridHelper.Templatecolumn(RoomDataView, Helper.DataGridHelper.FormControls.BoundColumn, "BookingStartDate", "BookingStartDate", "BookingStartDate", true, 90, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleCenter, DataGridViewContentAlignment.MiddleRight, Color.Transparent, null, "", "", Color.Black);
            // BoundColumn creation
            Helper.DataGridHelper.Templatecolumn(RoomDataView, Helper.DataGridHelper.FormControls.BoundColumn, "BookingEndDate", "BookingEndDate", "BookingEndDate", true, 90, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleCenter, DataGridViewContentAlignment.MiddleRight, Color.Transparent, null, "", "", Color.Black);

            Helper.DataGridHelper helper = new Helper.DataGridHelper();
            helper.DGVDetailGridClickEvents(RoomDataView);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialize the Room/Main grid
        /// </summary>
        /// <param name="objRoomList"></param>
        private void LocationGrid_Initialize(List <RoomModel> objRoomList)
        {
            //First generate the grid Layout Design
            Helper.DataGridHelper.Layouts(LocationDataView, Color.LightSteelBlue, Color.AliceBlue, Color.WhiteSmoke, false, Color.SteelBlue, false, false, false);

            //Set Height,width and add panel to your selected control
            Helper.DataGridHelper.GenerateDataGrid(LocationDataView, pnlDashBoard, 1000, 600, 10, 10);

            // Color Image Column creation
            Helper.DataGridHelper.Templatecolumn(LocationDataView, Helper.DataGridHelper.FormControls.ImageColumn, "img", "", "", true, 40, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleCenter, DataGridViewContentAlignment.MiddleRight, Color.Transparent, null, "", "", Color.Black);

            // BoundColumn creation with hiddern column
            Helper.DataGridHelper.Templatecolumn(LocationDataView, Helper.DataGridHelper.FormControls.BoundColumn, "LocationId", "Location Id", "Location Id",
                                                 false, 90, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleLeft, DataGridViewContentAlignment.MiddleCenter,
                                                 Color.Transparent, null, "", "", Color.Black);
            // BoundColumn creation with hiddern column
            Helper.DataGridHelper.Templatecolumn(LocationDataView, Helper.DataGridHelper.FormControls.BoundColumn, "RoomID", "Room Id", "Room Id",
                                                 false, 90, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleLeft, DataGridViewContentAlignment.MiddleCenter,
                                                 Color.Transparent, null, "", "", Color.Black);

            // BoundColumn creation
            Helper.DataGridHelper.Templatecolumn(LocationDataView, Helper.DataGridHelper.FormControls.BoundColumn, "LocationName", "Location Name", "Location Name",
                                                 true, 100, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleLeft, DataGridViewContentAlignment.MiddleCenter,
                                                 Color.Transparent, null, "", "", Color.Black);

            // BoundColumn creation
            Helper.DataGridHelper.Templatecolumn(LocationDataView, Helper.DataGridHelper.FormControls.BoundColumn, "RoomName", "Room Name",
                                                 "Room Name", true, 150, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleLeft, DataGridViewContentAlignment.MiddleCenter,
                                                 Color.Transparent, null, "", "", Color.Black);

            // BoundColumn creation
            Helper.DataGridHelper.Templatecolumn(LocationDataView, Helper.DataGridHelper.FormControls.BoundColumn, "RoomAddress", "Room Address",
                                                 "Room Address", true, 200, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleLeft, DataGridViewContentAlignment.MiddleCenter,
                                                 Color.Transparent, null, "", "", Color.Black);

            // Image column creation
            Helper.DataGridHelper.Templatecolumn(LocationDataView, Helper.DataGridHelper.FormControls.AvailableImageColumn, "AvailableStatus", "AvailableStatus",
                                                 "AvailableStatus", true, 100, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleLeft, DataGridViewContentAlignment.MiddleCenter,
                                                 Color.Transparent, null, "", "", Color.Black);
            //BoundColumn creation
            Helper.DataGridHelper.Templatecolumn(LocationDataView, Helper.DataGridHelper.FormControls.BoundColumn, "AvailableStatus", "AvailableStatus",
                                                 "AvailableStatus", false, 100, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleLeft, DataGridViewContentAlignment.MiddleCenter,
                                                 Color.Transparent, null, "", "", Color.Black);

            // BoundColumn creation
            Helper.DataGridHelper.Templatecolumn(LocationDataView, Helper.DataGridHelper.FormControls.BoundColumn, "Capacity", "Capacity",
                                                 "Capacity", true, 60, DataGridViewTriState.True, DataGridViewContentAlignment.MiddleLeft, DataGridViewContentAlignment.MiddleCenter,
                                                 Color.Transparent, null, "", "", Color.Black);



            //Convert the List to DataTable
            DataTable detailTableList = ListtoDataTable(Helper.DataGridHelper.objRoomBookingList);

            // Image Colum Click Event - In  this method we create an event for cell click and we will display the Detail grid with result.

            Helper.DataGridHelper helper = new Helper.DataGridHelper();
            helper.DGVMasterGridClickEvents(LocationDataView, RoomDataView, LocationDataView.Columns["img"].Index,
                                            Helper.DataGridHelper.EventTypes.cellContentClick, Helper.DataGridHelper.FormControls.ImageColumn, detailTableList, "RoomId");

            // Bind data to DGV.
            LocationDataView.DataSource = objRoomList;
        }