Пример #1
0
        private void DesignMainGrid()
        {
            dgvMain.RowCount    = 1;
            dgvMain.ColumnCount = 3;

            dgvMain.Columns[0].Name  = "S.No";
            dgvMain.Columns[0].Width = 40;


            dgvMain.Columns[1].Name  = "ID";
            dgvMain.Columns[1].Width = 100;


            dgvMain.Columns[2].Name  = "Unit Name";
            dgvMain.Columns[2].Width = 200;

            dgvMain.RowHeadersVisible        = false;
            dgvMain.AllowUserToDeleteRows    = false;
            dgvMain.AllowUserToAddRows       = false;
            dgvMain.AllowUserToResizeRows    = false;
            dgvMain.AllowUserToResizeColumns = true;
            dgvMain.EditMode      = DataGridViewEditMode.EditProgrammatically;
            dgvMain.ScrollBars    = ScrollBars.Both;
            dgvMain.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

            GlobalFunction.SetGridStyle(dgvMain);
        }
Пример #2
0
        private void DesignMainGrid()
        {
            dgvMain.RowCount    = 1;
            dgvMain.ColumnCount = 6;

            dgvMain.Columns[0].Name  = "S.No";
            dgvMain.Columns[0].Width = SNoWidth;
            dgvMain.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvMain.Columns[1].Name  = "ItemID";
            dgvMain.Columns[1].Width = ItemIDWidth;

            dgvMain.Columns[2].Name  = "ItemName";
            dgvMain.Columns[2].Width = ItemNameWidth;

            //dgvMain.Columns[3].Name = "Author";
            //dgvMain.Columns[3].Width = AuthorWidth;      //323

            //dgvMain.Columns[4].Name = "EditionYear";
            //dgvMain.Columns[4].Width = EditionYearWidth;
            //dgvMain.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            //dgvMain.Columns[5].Name = "EditionNo";
            //dgvMain.Columns[5].Width = EditionNoWidth;
            //dgvMain.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvMain.Columns[3].Name  = "Unit";
            dgvMain.Columns[3].Width = UnitWidth;      //323
            dgvMain.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvMain.Columns[4].Name  = "Rate";
            dgvMain.Columns[4].Width = UnitWidth;      //323
            dgvMain.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvMain.Columns[5].Name  = "Amount";
            dgvMain.Columns[5].Width = UnitWidth;      //323
            dgvMain.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;



            dgvMain.RowHeadersVisible        = false;
            dgvMain.AllowUserToDeleteRows    = false;
            dgvMain.AllowUserToAddRows       = false;
            dgvMain.AllowUserToResizeRows    = false;
            dgvMain.AllowUserToResizeColumns = true;
            dgvMain.EditMode      = DataGridViewEditMode.EditProgrammatically;
            dgvMain.ScrollBars    = ScrollBars.Both;
            dgvMain.SelectionMode = DataGridViewSelectionMode.CellSelect;

            GlobalFunction.SetGridStyle(dgvMain);

            //}
        }