本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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");
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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");
}
示例13: TestMappingNameChangedEvent
public void TestMappingNameChangedEvent ()
{
DataGridTextBoxColumn col = new DataGridTextBoxColumn ();
eventhandled = false;
col.MappingNameChanged += new EventHandler (OnEventHandler);
col.MappingName = "name1";
Assert.AreEqual (true, eventhandled, "A1");
}
示例14: SopClassesUserControl
/// <summary>
/// Constructor
/// </summary>
public SopClassesUserControl()
{
InitializeComponent();
_theDefinitionFileTextColumn = new DataGridTextBoxColumn();
Initialize();
//UpdateDataGrid();
}
示例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();
}
}