示例#1
0
        private void DesignSumGrid()
        {
            dgvTotal.RowCount    = 1;
            dgvTotal.ColumnCount = 17;


            dgvTotal.Columns[0].Name    = "S.No";
            dgvTotal.Columns[0].Width   = SNoWidth;
            dgvTotal.Columns[0].Visible = false;

            //Share Name
            dgvTotal.Columns[1].Name  = "SHID";
            dgvTotal.Columns[1].Width = SHIDWidth;
            dgvTotal.Columns[2].Name  = "SID";
            dgvTotal.Columns[2].Width = SIDWidth;
            dgvTotal.Columns[3].Name  = "Share Name";
            dgvTotal.Columns[3].Width = ShareNameWidth + SNoWidth;      //323
            dgvTotal.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;

            //Capital
            dgvTotal.Columns[4].Name  = "PrevCapital";
            dgvTotal.Columns[4].Width = PrevCapitalWidth;
            dgvTotal.Columns[4].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;


            dgvTotal.Columns[5].Name  = "Fee";
            dgvTotal.Columns[5].Width = CapitalFeeWidth;
            dgvTotal.Columns[5].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvTotal.Columns[6].Name  = "Total Cap.";
            dgvTotal.Columns[6].Width = TotalCapitalWidth;      //323
            dgvTotal.Columns[6].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            //Loan
            dgvTotal.Columns[7].Name  = "PrevLoan";
            dgvTotal.Columns[7].Width = PrevLoanWidthWidth;
            dgvTotal.Columns[7].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvTotal.Columns[8].Name  = "LoanReturn";
            dgvTotal.Columns[8].Width = LoanReturnWidth;
            dgvTotal.Columns[8].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvTotal.Columns[9].Name  = "BalLoan";
            dgvTotal.Columns[9].Width = BalanceLoanWidth;
            dgvTotal.Columns[9].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvTotal.Columns[10].Name  = "Interest";
            dgvTotal.Columns[10].Width = InterestWidth;
            dgvTotal.Columns[10].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            //Spcl. Loan
            //dgvTotal.Columns[11].Name = "SpclPrevLoan";
            //dgvTotal.Columns[11].Width = 100;
            //dgvTotal.Columns[12].Name = "SpclLoanReturn";
            //dgvTotal.Columns[12].Width = 100;
            //dgvTotal.Columns[13].Name = "SpclBalLoan";
            //dgvTotal.Columns[13].Width = 100;
            //dgvTotal.Columns[14].Name = "SplInterest";
            //dgvTotal.Columns[14].Width = 80;

            //New Loan
            dgvTotal.Columns[11].Name  = "NewLoan";
            dgvTotal.Columns[11].Width = NewLoanWidth;
            dgvTotal.Columns[11].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvTotal.Columns[12].Name  = "NewInt";
            dgvTotal.Columns[12].Width = NewInterestWidth;
            dgvTotal.Columns[12].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            // New Spcl.Loan
            //dgvTotal.Columns[17].Name = "SpclNewLoan";
            //dgvTotal.Columns[17].Width = 100;
            //dgvTotal.Columns[18].Name = "SpclNewInt";
            //dgvTotal.Columns[18].Width = 80;


            dgvTotal.Columns[13].Name  = "Penalty";
            dgvTotal.Columns[13].Width = PenaltyWidth;
            dgvTotal.Columns[13].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvTotal.Columns[14].Name  = "Total_Loan";
            dgvTotal.Columns[14].Width = TotalLoanWidth;
            dgvTotal.Columns[14].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvTotal.Columns[15].Name  = "Deposit";
            dgvTotal.Columns[15].Width = DepositWidth;
            dgvTotal.Columns[15].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;

            dgvTotal.Columns[16].Name  = "Remarks";
            dgvTotal.Columns[16].Width = ShareRemarksWidth;      //323
            dgvTotal.Columns[16].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight;


            dgvTotal.RowHeadersVisible        = false;
            dgvTotal.ColumnHeadersVisible     = false;
            dgvTotal.AllowUserToDeleteRows    = false;
            dgvTotal.AllowUserToAddRows       = false;
            dgvTotal.AllowUserToResizeRows    = false;
            dgvTotal.AllowUserToResizeColumns = true;
            dgvTotal.EditMode              = DataGridViewEditMode.EditProgrammatically;
            dgvTotal.ScrollBars            = ScrollBars.Both;
            dgvTotal.SelectionMode         = DataGridViewSelectionMode.CellSelect;
            dgvTotal.DefaultCellStyle.Font = new Font(dgvTotal.Font.FontFamily, 9.0F, FontStyle.Bold);
            dgvTotal.RowTemplate.Height    = 27;

            GlobalFunction.SetGridStyle(dgvTotal);

            if (GlobalFunction.glbUserType == GlobalFunction.SuperUser)
            {
                dgvTotal.Columns[1].Visible = true;   //ID
                dgvTotal.Columns[2].Visible = true;
            }
            else
            {
                dgvTotal.Columns[1].Visible = false;
                dgvTotal.Columns[2].Visible = false;
            }


            //if (Meeting.SpecialLoanScheme == 1)
            //{
            //    dgvTotal.Columns[11].Visible = true;
            //    dgvTotal.Columns[12].Visible = true;
            //    dgvTotal.Columns[13].Visible = true;
            //    dgvTotal.Columns[14].Visible = true;
            //    dgvTotal.Columns[17].Visible = true;
            //    dgvTotal.Columns[18].Visible = true;
            //}
            //else
            //{
            //    dgvTotal.Columns[11].Visible = false;
            //    dgvTotal.Columns[12].Visible = false;
            //    dgvTotal.Columns[13].Visible = false;
            //    dgvTotal.Columns[14].Visible = false;
            //    dgvTotal.Columns[17].Visible = false;
            //    dgvTotal.Columns[18].Visible = false;
            //}


            dgvTotal.RowCount = 1;
            dgvTotal.Rows[0].Cells[ShareName].Value = "Total";
        }