當前位置: 首頁>>代碼示例>>C#>>正文


C# Forms.DataGridTextBoxColumn類代碼示例

本文整理匯總了C#中System.Windows.Forms.DataGridTextBoxColumn的典型用法代碼示例。如果您正苦於以下問題:C# DataGridTextBoxColumn類的具體用法?C# DataGridTextBoxColumn怎麽用?C# DataGridTextBoxColumn使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DataGridTextBoxColumn類屬於System.Windows.Forms命名空間,在下文中一共展示了DataGridTextBoxColumn類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: setupColumns

        private void setupColumns()
        {
            DataGridTextBoxColumn tCol;

            tCol = new DataGridTextBoxColumn();
            tCol.HeaderText = "Name";
            tCol.MappingName = "Name";
            tCol.Width = 100;

            this.rateDataGrid.TableStyles[0].GridColumnStyles.Add(tCol);

            tCol = new DataGridTextBoxColumn();
            tCol.HeaderText = "Codes";
            tCol.MappingName = "Codes";
            tCol.Width = 100;

            this.rateDataGrid.TableStyles[0].GridColumnStyles.Add(tCol);

            tCol = new DataGridTextBoxColumn();
            tCol.HeaderText = "Rate";
            tCol.MappingName = "Rate";
            tCol.Width = 100;

            this.rateDataGrid.TableStyles[0].GridColumnStyles.Add(tCol);

            tCol = new DataGridTextBoxColumn();
            tCol.HeaderText = "PassThrus";
            tCol.MappingName = "PassThrus";
            tCol.Width = 100;

            this.rateDataGrid.TableStyles[0].GridColumnStyles.Add(tCol);
        }
開發者ID:RookieOne,項目名稱:RMS_Refactor,代碼行數:32,代碼來源:FloorGrid.cs

示例2: InitGrid

        /// <summary>
        /// 初始化表格控件
        /// </summary>
        private void InitGrid()
        {
            var dgts = new DataGridTableStyle { MappingName = prods.ProDelivery.TableName };


            DataGridColumnStyle dgRowNo = new DataGridTextBoxColumn();
            dgRowNo.Width = 40;
            dgRowNo.MappingName = prods.ProDelivery.RowNoColumn.ColumnName;
            dgRowNo.HeaderText = "序號";
            dgts.GridColumnStyles.Add(dgRowNo);

            //DataGridColumnStyle dgAutoID = new DataGridTextBoxColumn();
            //dgAutoID.Width = 40;
            //dgAutoID.MappingName = "AutoID";
            //dgAutoID.HeaderText = "";
            //dgts.GridColumnStyles.Add(dgAutoID);

            DataGridColumnStyle dgccOrderNumber = new DataGridTextBoxColumn();
            dgccOrderNumber.Width = 120;
            dgccOrderNumber.MappingName = "cCode";
            dgccOrderNumber.HeaderText = "單號";
            dgts.GridColumnStyles.Add(dgccOrderNumber);


            DataGridColumnStyle dgccCusName = new DataGridTextBoxColumn();
            dgccCusName.Width = 70;
            dgccCusName.MappingName = "cCusName";
            dgccCusName.HeaderText = "客戶";
            dgts.GridColumnStyles.Add(dgccCusName);

            DataGridColumnStyle dgccMaker = new DataGridTextBoxColumn();
            dgccMaker.Width = 70;
            dgccMaker.MappingName = "cMaker";
            dgccMaker.HeaderText = "製單人";
            dgts.GridColumnStyles.Add(dgccMaker);

            DataGridColumnStyle dgccDepName = new DataGridTextBoxColumn();
            dgccDepName.Width = 70;
            dgccDepName.MappingName = "cDepName";
            dgccDepName.HeaderText = "部門";
            dgts.GridColumnStyles.Add(dgccDepName);

            DataGridColumnStyle dgcMemo = new DataGridTextBoxColumn();
            dgcMemo.Width = 70;
            dgcMemo.MappingName = "cMemo";
            dgcMemo.HeaderText = "備注";
            dgts.GridColumnStyles.Add(dgcMemo);

            DataGridColumnStyle dgccVerifyState = new DataGridTextBoxColumn();
            dgccVerifyState.Width = 70;
            dgccVerifyState.MappingName = "cVerifyState";
            dgccVerifyState.HeaderText = "狀態";
            dgts.GridColumnStyles.Add(dgccVerifyState);


            dGridMain.TableStyles.Clear();
            dGridMain.TableStyles.Add(dgts);
            dGridMain.DataSource = prods.ProDelivery;

        }
開發者ID:JARANTeam,項目名稱:HPDA,代碼行數:63,代碼來源:ProDeliveryDownload.cs

示例3: InitValues

		private void InitValues()
		{
			// Initialize the DataGrid columns
			dgtbName = new DataGridTextBoxColumn();
			dgtbValue = new DataGridTextBoxColumn();

			this.dgTableStyle.GridColumnStyles.AddRange(new DataGridColumnStyle[] {
															this.dgtbName,
															this.dgtbValue});
			// 
			// dgtbFE
			// 
			dgtbName.HeaderText = "Parameter Name";
			dgtbName.MappingName = "Name";
			dgtbName.Width = 75;
			// 
			// dgtbValue
			// 
			this.dgtbValue.HeaderText = "Value";
			this.dgtbValue.MappingName = "Value";
			this.dgtbValue.Width = 75;
//			string[] parms = _Draw.GetReportParameters(true);
//			if (parms != null)
//				dgtbFV.CB.Items.AddRange(parms);

			// Initialize the DataGrid
			this.dgParms.DataSource = _dsv.QueryParameters;

			DataGridTableStyle ts = dgParms.TableStyles[0];
			ts.GridColumnStyles[0].Width = 140;
			ts.GridColumnStyles[1].Width = 140;
		}
開發者ID:mnisl,項目名稱:OD,代碼行數:32,代碼來源:QueryParametersCtl.cs

示例4: TestAdd

		public void TestAdd ()
		{
			DataGridTableStyle ts = new DataGridTableStyle ();
			GridColumnStylesCollection sc = ts.GridColumnStyles;			
			sc.CollectionChanged += new CollectionChangeEventHandler (OnCollectionEventHandler);

			// Add single
			ResetEventData ();
			DataGridTextBoxColumn col1 = new DataGridTextBoxColumn ();
			col1.MappingName = "Column1";
			sc.Add (col1);
			Assert.AreEqual (true, eventhandled);
			Assert.AreEqual (col1, Element);
			Assert.AreEqual (CollectionChangeAction.Add, Action);

			// Add multiple
			ResetEventData ();
			DataGridTextBoxColumn elem1 = new DataGridTextBoxColumn ();
			DataGridTextBoxColumn elem2 = new DataGridTextBoxColumn ();
			sc.AddRange (new DataGridTextBoxColumn [] {elem1, elem2});
			Assert.AreEqual (true, eventhandled, "A1");
			Assert.AreEqual (CollectionChangeAction.Add, Action, "A2");
			Assert.AreEqual (elem2, Element, "A3");
			
		}
開發者ID:nlhepler,項目名稱:mono,代碼行數:25,代碼來源:GridColumnStylesCollectionTest.cs

示例5: frmStock_Items

        public static DataGridTableStyle frmStock_Items()
        {
            DataGridTableStyle dtStyle = new DataGridTableStyle();
            dtStyle.MappingName = "table";

            DataGridTextBoxColumn id = new DataGridTextBoxColumn();
            id.MappingName = "id";
            id.HeaderText = "ID";
            id.Width = 30;
            dtStyle.GridColumnStyles.Add(id);

            DataGridTextBoxColumn lotno = new DataGridTextBoxColumn();
            lotno.MappingName = "lot_no";
            lotno.HeaderText = "Lot#";
            lotno.Width = 80;
            dtStyle.GridColumnStyles.Add(lotno);

            DataGridTextBoxColumn qty = new DataGridTextBoxColumn();
            qty.MappingName = "qty";
            qty.HeaderText = "Qty";
            qty.Width = 96;
            dtStyle.GridColumnStyles.Add(qty);

            return dtStyle;
        }
開發者ID:kingpauloaquino,項目名稱:CERP-Portable,代碼行數:25,代碼來源:DataGrid_Style.cs

示例6: CreateDataGridTableStyle

        public static DataGridTableStyle CreateDataGridTableStyle(string tableMappingName,string[] dbColName,
			string[] dgShowName,int[] boolColumnIndex)
        {
            ArgumentChecker.CheckNotNull(dbColName);
            ArgumentChecker.CheckNotNull(dgShowName);
            if(dbColName.Length !=dgShowName.Length )
                throw new ArgumentException("dbColName.length !=dgShowName.Length");

            DataGridTableStyle dgts=new DataGridTableStyle();
            dgts.MappingName=tableMappingName;

            DataGridColumnStyle dgcs=null;
            for(int i=0;i<dbColName.Length;i++)
            {
                if(InArray(boolColumnIndex,i))
                    dgcs=new DataGridBoolColumn();
                else
                    dgcs=new DataGridTextBoxColumn();
                dgcs.MappingName=dbColName[i];
                dgcs.HeaderText=dgShowName[i];

                dgts.GridColumnStyles.Add(dgcs);
            }
            return dgts;
        }
開發者ID:hkiaipc,項目名稱:lx,代碼行數:25,代碼來源:Misc.cs

示例7: getTableStyle

        public DataGridTableStyle getTableStyle()
        {
            DataGridTableStyle style = new DataGridTableStyle();
            style.MappingName = "ArrayList";

            DataGridTextBoxColumn column = new DataGridTextBoxColumn();
            column.MappingName = "Name";
            column.HeaderText = "Name";
            column.Format = "f4";
            column.Width = 150;
            style.GridColumnStyles.Add(column);

            column = new DataGridTextBoxColumn();
            column.MappingName = "Status";
            column.HeaderText = "Completed";
            column.Format = "f4";
            column.Width = 85;
            style.GridColumnStyles.Add(column);

            column = new DataGridTextBoxColumn();
            column.MappingName = "SupportID";
            column.HeaderText = "SupportID";
            column.Format = "d";
            column.Width = 25;
            style.GridColumnStyles.Add(column);

            column = new DataGridTextBoxColumn();
            column.MappingName = "StatusID";
            column.HeaderText = "StatusID";
            column.Format = "d";
            column.Width = 25;
            style.GridColumnStyles.Add(column);

            return style;
        }
開發者ID:testdoron,項目名稱:ProScan,代碼行數:35,代碼來源:TestForm.cs

示例8: setupColumns

        private void setupColumns()
        {
            DataGridTextBoxColumn tCol;

            tCol = new DataGridTextBoxColumn();
            tCol.HeaderText = "Name";
            tCol.MappingName = "Name";
            tCol.Width = Convert.ToInt16(rateDataGrid.Width * .35);

            this.rateDataGrid.TableStyles[0].GridColumnStyles.Add(tCol);

            tCol = new DataGridTextBoxColumn();
            tCol.HeaderText = "Codes";
            tCol.MappingName = "Codes";
            tCol.Width = Convert.ToInt16(rateDataGrid.Width * .35);

            this.rateDataGrid.TableStyles[0].GridColumnStyles.Add(tCol);

            tCol = new DataGridTextBoxColumn();
            tCol.HeaderText = "Rate";
            tCol.MappingName = "Rate";
            tCol.Format = "C0";
            tCol.Alignment = System.Windows.Forms.HorizontalAlignment.Right;
            tCol.Width = Convert.ToInt16(rateDataGrid.Width * .3);

            this.rateDataGrid.TableStyles[0].GridColumnStyles.Add(tCol);
        }
開發者ID:RookieOne,項目名稱:RMS_Refactor,代碼行數:27,代碼來源:PerDiemGrid.cs

示例9: generatedatagrid

        public void generatedatagrid()
        {
            DataGridTableStyle tableStyle = new DataGridTableStyle();
            tableStyle.MappingName = arr1.GetType().Name;

            DataGridTextBoxColumn tbcName = new DataGridTextBoxColumn();
            tbcName.Width = dataGrid1.Width * 50 / 100;
            tbcName.MappingName = "EPC";
            tbcName.HeaderText = "EPC";
            tableStyle.GridColumnStyles.Add(tbcName);

            tbcName = new DataGridTextBoxColumn();
            tbcName.Width = dataGrid1.Width * 20 / 100;
            tbcName.MappingName = "Timestamp";
            tbcName.HeaderText = "Timestamp";
            tableStyle.GridColumnStyles.Add(tbcName);

            tbcName = new DataGridTextBoxColumn();
            tbcName.Width = dataGrid1.Width * 15 / 100;
            tbcName.MappingName = "ReadCount";
            tbcName.HeaderText = "ReadCount";
            tableStyle.GridColumnStyles.Add(tbcName);

            tbcName = new DataGridTextBoxColumn();
            tbcName.Width = dataGrid1.Width * 12 / 100;
            tbcName.MappingName = "Rssi";
            tbcName.HeaderText = "Rssi";
            tableStyle.GridColumnStyles.Add(tbcName);

            dataGrid1.TableStyles.Clear();
            dataGrid1.TableStyles.Add(tableStyle);
        }
開發者ID:colombmo,項目名稱:itsi-gamification,代碼行數:32,代碼來源:Form1.cs

示例10: InitValues

		private void InitValues()
		{
			// Initialize the DataGrid columns
			dgtbExpr = new DataGridTextBoxColumn();
		
			dgtbDir = new DataGridBoolColumn();

			this.dgTableStyle.GridColumnStyles.AddRange(new DataGridColumnStyle[] {
															this.dgtbExpr,
															this.dgtbDir});
			// 
			// dgtbExpr
			// 
			
			dgtbExpr.HeaderText = "Sort Expression";
			dgtbExpr.MappingName = "SortExpression";
			dgtbExpr.Width = 75;
			// Get the parent's dataset name
//			string dataSetName = _Draw.GetDataSetNameValue(_SortingParent);
//
//			string[] fields = _Draw.GetFields(dataSetName, true);
//			if (fields != null)
//				dgtbExpr.CB.Items.AddRange(fields);
			// 
			// dgtbDir
			// 
			dgtbDir.HeaderText = "Sort Ascending";
			dgtbDir.MappingName = "Direction";
			dgtbDir.Width = 70;
			dgtbDir.AllowNull = false;

			// Initialize the DataTable
			_DataTable = new DataTable();
			_DataTable.Columns.Add(new DataColumn("SortExpression", typeof(string)));
			_DataTable.Columns.Add(new DataColumn("Direction", typeof(bool)));

			object[] rowValues = new object[2];
			XmlNode sorts = _Draw.GetNamedChildNode(_SortingParent, "Sorting");

			if (sorts != null)
			foreach (XmlNode sNode in sorts.ChildNodes)
			{
				if (sNode.NodeType != XmlNodeType.Element || 
						sNode.Name != "SortBy")
					continue;
				rowValues[0] = _Draw.GetElementValue(sNode, "SortExpression", "");
				if (_Draw.GetElementValue(sNode, "Direction", "Ascending") == "Ascending")
					rowValues[1] = true;
				else
					rowValues[1] = false;

				_DataTable.Rows.Add(rowValues);
			}
			this.dgSorting.DataSource = _DataTable;
			DataGridTableStyle ts = dgSorting.TableStyles[0];
			ts.PreferredRowHeight = 14;
			ts.GridColumnStyles[0].Width = 240;
			ts.GridColumnStyles[1].Width = 90;
		}
開發者ID:romeroyonatan,項目名稱:opendental,代碼行數:59,代碼來源:SortingCtl.cs

示例11: AddColumn

 public static void AddColumn(this DataGrid dataGrid, string caption, string columnName, int width)
 {
     DataGridTextBoxColumn ColumnStyle = new DataGridTextBoxColumn();
     ColumnStyle.HeaderText = caption;
     ColumnStyle.MappingName = columnName;
     ColumnStyle.Width = width;
     dataGrid.TableStyles["Mobile"].GridColumnStyles.Add(ColumnStyle);
 }
開發者ID:AramisIT,項目名稱:FMCG,代碼行數:8,代碼來源:DataTableEx.cs

示例12: TestAlignmentChangedEvent

		public void TestAlignmentChangedEvent ()
		{
			DataGridTextBoxColumn col = new DataGridTextBoxColumn ();
			eventhandled = false;
			col.AlignmentChanged += new EventHandler (OnEventHandler);
			col.Alignment = HorizontalAlignment.Center;
			Assert.AreEqual (true, eventhandled, "A1");
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:8,代碼來源:DataGridTextBoxColumnTest.cs

示例13: TestMappingNameChangedEvent

		public void TestMappingNameChangedEvent ()
		{
			DataGridTextBoxColumn col = new DataGridTextBoxColumn ();
			eventhandled = false;
			col.MappingNameChanged += new EventHandler (OnEventHandler);
			col.MappingName = "name1";
			Assert.AreEqual (true, eventhandled, "A1");
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:8,代碼來源:DataGridTextBoxColumnTest.cs

示例14: SopClassesUserControl

        /// <summary>
        /// Constructor
        /// </summary>
        public SopClassesUserControl()
        {
            InitializeComponent();

            _theDefinitionFileTextColumn = new DataGridTextBoxColumn();

            Initialize();
            //UpdateDataGrid();
        }
開發者ID:ewcasas,項目名稱:DVTK,代碼行數:12,代碼來源:SOPClassUserControl.cs

示例15: FormSTO_Load

        private void FormSTO_Load(object sender, EventArgs e)
        {
            buttonConvert.Hide();
            try
            {
                SqlDataReader dr;
                string sqls = "SELECT COUNT(TagID),COUNT([TagDuplicate]),COUNT(*) FROM MasterKanban";
                SqlCommand cmd = new SqlCommand(sqls, Connect.con2);
                if (Connect.con2.State == ConnectionState.Closed) { Connect.con2.Open(); }
                dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    labelUniq.Text = "Uniq Item : " + dr[0].ToString();
                    labelDuplicate.Text = "Duplicate Item : " + dr[1].ToString();
                    labelTotal.Text = "Total Scan Item : " + dr[2].ToString();
                }
                dr.Close();
                cmd.Dispose();
                if (Connect.con2.State == ConnectionState.Open) { Connect.con2.Close(); }

                DataSet ds = new DataSet();
                string strSQL = "  select distinct(TagDuplicate), count(TagDuplicate) as Jumlah from MasterKanban where TagDuplicate is not null group by TagDuplicate";
                SqlDataAdapter da = new SqlDataAdapter(strSQL, Connect.con2);
                da.Fill(ds, "LogDuplicat");
                dataGridListDuplicat.DataSource = ds.Tables[0];

                DataGridTableStyle ts = new DataGridTableStyle();
                dataGridListDuplicat.TableStyles.Clear();
                ts.MappingName = "LogDuplicat";

                DataGridTextBoxColumn col1 = new DataGridTextBoxColumn();
                col1.HeaderText = "TagDuplicate";
                col1.MappingName = "TagDuplicate";
                col1.Width = 190;
                ts.GridColumnStyles.Add(col1);

                DataGridTextBoxColumn col2 = new DataGridTextBoxColumn();
                col2.HeaderText = "Jumlah";
                col2.MappingName = "Jumlah";
                col2.Width = 40;
                ts.GridColumnStyles.Add(col2);

                dataGridListDuplicat.TableStyles.Add(ts);
                dataGridListDuplicat.Refresh();

                ds.Tables.Clear();
                da.Dispose();
                ds.Dispose();
                dataGridListDuplicat.Enabled = true;
                
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                this.Close();
            }
        }
開發者ID:exucupers,項目名稱:Akebonbon-PDT-RFID-MC55,代碼行數:57,代碼來源:FormSTO.cs


注:本文中的System.Windows.Forms.DataGridTextBoxColumn類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。