Пример #1
0
        void PopualteData()
        {
            int    iPartyID = 0, TM02_MAIN_PRODUCTSIZEID = 0;
            string sPartyID = "", sTM02_MAIN_PRODUCTSIZEID = "";

            if (!string.IsNullOrEmpty(cmbName.Text.Trim()))
            {
                int.TryParse(cmbName.SelectedValue.ToString(), out iPartyID);
            }
            //if (!string.IsNullOrEmpty(cmbMainItemSize.Text.Trim()))
            //    int.TryParse(cmbMainItemSize.SelectedValue.ToString(), out TM02_MAIN_PRODUCTSIZEID);

            if (iPartyID > 0)
            {
                sPartyID = iPartyID.ToString();
            }
            if (TM02_MAIN_PRODUCTSIZEID > 0)
            {
                sTM02_MAIN_PRODUCTSIZEID = TM02_MAIN_PRODUCTSIZEID.ToString();
            }

            MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
            List <USP_VP_GET_PRODUCTITEMResult> lstCategory = new List <USP_VP_GET_PRODUCTITEMResult>();

            lstCategory = MyDa.USP_VP_GET_PRODUCTITEM("", sPartyID, null, null, Datalayer.iT001_COMPANYID.ToString()).ToList();
            dgDisplayData.DataSource = lstCategory;

            dgDisplayData.Columns["TM03_PRODUCTITEMID"].Visible = false;
            //dgDisplayData.Columns["TM02_MAIN_PRODUCTSIZEID"].Visible = false;
            dgDisplayData.Columns["TM01_MAIN_PRODUCTID"].Visible = false;
            dgDisplayData.Columns["TM01_PRODUCTID"].Visible      = false;
            dgDisplayData.Columns["TM01_PRODUCTID1"].Visible     = false;
            //dgDisplayData.Columns["TM01_PRODUCTID2"].Visible = false;
            //dgDisplayData.Columns["TM02_PRODUCTSIZEID"].Visible = false;
            //dgDisplayData.Columns["TM02_PRODUCTSIZEID1"].Visible = false;
            dgDisplayData.Columns["TM01_ISSET"].Visible = false;
            //dgDisplayData.Columns["TM02_PRICE"].Visible = false;
            dgDisplayData.Columns["TM01_HSNCODE"].Visible = false;
            //dgDisplayData.Columns["TM01_TAX_RATE"].Visible = false;
            dgDisplayData.Columns["TM_COMPAYID"].Visible  = false;
            dgDisplayData.Columns["TM_COMPAYID1"].Visible = false;
            dgDisplayData.Columns["TM01_PRICE"].Visible   = false;

            //dgDisplayData.Columns["TM01_NO"].HeaderText = "No";
            dgDisplayData.Columns["TM01_NAME"].HeaderText = "Name";
            //dgDisplayData.Columns["TM02_SIZE"].HeaderText = "Size";
            dgDisplayData.Columns["TM03_QTY"].HeaderText = "Qty";

            //dgDisplayData.Columns["TM01_NO"].DisplayIndex = 0;
            dgDisplayData.Columns["TM01_NAME"].DisplayIndex = 1;
            //dgDisplayData.Columns["TM02_SIZE"].DisplayIndex = 2;
            dgDisplayData.Columns["TM03_QTY"].DisplayIndex = 3;

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

            // 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;
        }