Beispiel #1
0
        void PopualteData()
        {
            string TM02_PARTYID  = "";
            int    iTM02_PARTYID = 0;

            if (!string.IsNullOrEmpty(cmbName.Text.Trim()))
            {
                int.TryParse(cmbName.SelectedValue.ToString(), out iTM02_PARTYID);
            }

            if (iTM02_PARTYID > 0)
            {
                TM02_PARTYID = iTM02_PARTYID.ToString();
            }

            MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
            List <USP_VP_GET_LOANResult> lst = new List <USP_VP_GET_LOANResult>();

            lst = MyDa.USP_VP_GET_LOAN("", TM02_PARTYID, dtpFromDate.Value, dtpTodate.Value, Datalayer.iT001_COMPANYID.ToString()).ToList();
            dgDisplayData.DataSource = lst;

            dgDisplayData.Columns["T15_LOANID"].Visible   = false;
            dgDisplayData.Columns["T14_WORKERID"].Visible = false;
            dgDisplayData.Columns["T14_DETAILS"].Visible  = false;
            dgDisplayData.Columns["TM_COMPAYID"].Visible  = false;
            dgDisplayData.Columns["T14_PHONE_NO"].Visible = false;
            dgDisplayData.Columns["T14_ADDRESS"].Visible  = false;

            dgDisplayData.Columns["T14_NAME"].HeaderText = "Name";
            dgDisplayData.Columns["T14_DATE"].HeaderText = "Date";
            dgDisplayData.Columns["T14_DATE"].DefaultCellStyle.Format = "dd-MM-yyyy";
            dgDisplayData.Columns["T14_AMOUNT"].HeaderText            = "Amount";

            dgDisplayData.Columns["T14_NAME"].DisplayIndex   = 0;
            dgDisplayData.Columns["T14_DATE"].DisplayIndex   = 1;
            dgDisplayData.Columns["T14_AMOUNT"].DisplayIndex = 2;

            this.dgDisplayData.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dgDisplayData.ColumnHeadersDefaultCellStyle.BackColor = Color.FromArgb(Datalayer.sGridHeaderColor1, Datalayer.sGridHeaderColor2, Datalayer.sGridHeaderColor3);
            dgDisplayData.EnableHeadersVisualStyles = false;
            this.dgDisplayData.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleLeft;

            // dgCategory.CurrentRow.DefaultCellStyle.BackColor = Color.White;
            dgDisplayData.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
            dgDisplayData.ColumnHeadersHeight         = 30;

            dgDisplayData.ColumnHeadersDefaultCellStyle.Font      = new System.Drawing.Font("Tahoma", 12F, FontStyle.Bold, GraphicsUnit.Pixel);
            dgDisplayData.ColumnHeadersDefaultCellStyle.ForeColor = Color.White;

            dgDisplayData.Columns["T14_NAME"].Width = 350;
        }