本文整理汇总了C#中System.Windows.Forms.DataGridViewTextBoxColumn类的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewTextBoxColumn类的具体用法?C# DataGridViewTextBoxColumn怎么用?C# DataGridViewTextBoxColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridViewTextBoxColumn类属于System.Windows.Forms命名空间,在下文中一共展示了DataGridViewTextBoxColumn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: fillTrainingBags
private void fillTrainingBags()
{
DataGridViewColumn dgvIndex = new DataGridViewTextBoxColumn();
{
dgvIndex.HeaderText = "Slot";
dgvIndex.DisplayIndex = 0;
dgvIndex.Width = 25;
dgvIndex.ReadOnly = true;
dgvIndex.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
}
DataGridViewComboBoxColumn dgvBag = new DataGridViewComboBoxColumn
{
DisplayStyle = DataGridViewComboBoxDisplayStyle.Nothing
};
{
foreach (string t in trba)
if (t.Length > 0)
dgvBag.Items.Add(t);
dgvBag.DisplayIndex = 1;
dgvBag.Width = 135;
dgvBag.FlatStyle = FlatStyle.Flat;
}
dataGridView1.Columns.Add(dgvIndex);
dataGridView1.Columns.Add(dgvBag);
dataGridView1.Rows.Add(12);
int offset = Main.SAV.SuperTrain + 0x308;
for (int i = 0; i < 12; i++)
{
dataGridView1.Rows[i].Cells[0].Value = (i + 1).ToString();
dataGridView1.Rows[i].Cells[1].Value = trba[sav[offset + i]];
}
}
示例2: TimelineView
public TimelineView(TimelineController controller_)
{
controller = controller_;
controller.TimelineUpdate += controller_TimelineUpdate;
controller.CurrentTimeUpdate += controller_CurrentTimeUpdate;
textWidth = 100;
barWidth = 100;
SetupUI();
this.MouseDown += TimelineView_MouseDown;
this.VisibleChanged += TimelineView_VisibleChanged;
this.Move += TimelineView_Move;
this.FormClosing += TimelineView_FormClosing;
typeof(DataGridView).
GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic).
SetValue(dataGridView, true, null);
dataGridView.SelectionChanged += (object sender, EventArgs args) => dataGridView.ClearSelection();
dataGridView.AutoGenerateColumns = false;
dataGridView.Columns.Add(textColumn = new DataGridViewTextBoxColumn { DataPropertyName = "Name", AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill });
dataGridView.Columns.Add(timeLeftColumn = new TimeLeftColumn { Controller = controller_ });
MyOpacity = 0.8;
NumberOfRowsToDisplay = 3;
MoveByDrag = true;
ShowOverlayButtons = true;
UpdateLayout();
soundplayer = new CachedSoundPlayer();
TimelineFont = new Font(FontFamily.GenericSansSerif, 12, FontStyle.Bold);
}
示例3: InitializeParameterGrid
private void InitializeParameterGrid()
{
MethodParametersGrid.AutoGenerateColumns = false;
MethodParametersGrid.Columns.Clear();
MethodParametersGrid.DataSource = _parameters;
MethodParametersGrid.AlternatingRowsDefaultCellStyle.BackColor = Color.Lavender;
MethodParametersGrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
var paramNameColumn = new DataGridViewTextBoxColumn
{
Name = "Name",
DataPropertyName = "Name",
HeaderText = RubberduckUI.Name,
ReadOnly = true
};
var paramTypeColumn = new DataGridViewTextBoxColumn
{
Name = "TypeName",
DataPropertyName = "TypeName",
HeaderText = RubberduckUI.Type,
ReadOnly = true
};
var paramPassedByColumn = new DataGridViewTextBoxColumn
{
Name = "Passed",
AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,
HeaderText = RubberduckUI.Passed,
DataPropertyName = "Passed",
ReadOnly = true
};
MethodParametersGrid.Columns.AddRange(paramNameColumn, paramTypeColumn, paramPassedByColumn);
}
示例4: generarGrilla
private void generarGrilla()
{
DataGridViewTextBoxColumn ColDia = new DataGridViewTextBoxColumn();
ColDia.DataPropertyName = "StringDia";
ColDia.HeaderText = "Día";
ColDia.Width = 120;
grillaAgenda.Columns.Add(ColDia);
DataGridViewTextBoxColumn ColHoraDesde = new DataGridViewTextBoxColumn();
ColHoraDesde.DataPropertyName = "HoraDesde";
ColHoraDesde.HeaderText = "Hora Desde";
ColHoraDesde.Width = 120;
grillaAgenda.Columns.Add(ColHoraDesde);
DataGridViewTextBoxColumn ColHoraHasta = new DataGridViewTextBoxColumn();
ColHoraHasta.DataPropertyName = "HoraHasta";
ColHoraHasta.HeaderText = "Hora Hasta";
ColHoraHasta.Width = 120;
grillaAgenda.Columns.Add(ColHoraHasta);
DataGridViewTextBoxColumn ColEspecialidad = new DataGridViewTextBoxColumn();
ColEspecialidad.DataPropertyName = "EspString";
ColEspecialidad.HeaderText = "Especialidad";
ColEspecialidad.Width = 120;
grillaAgenda.Columns.Add(ColEspecialidad);
}
示例5: ConfigurarColunasPrincipais
protected void ConfigurarColunasPrincipais()
{
DataGridViewTextBoxColumn IDAmbiente = new DataGridViewTextBoxColumn();
DataGridViewTextBoxColumn Cor = new DataGridViewTextBoxColumn();
DataGridViewTextBoxColumn Descricao = new DataGridViewTextBoxColumn();
IDAmbiente.DataPropertyName = "IDAmbiente";
IDAmbiente.HeaderText = "ID";
IDAmbiente.Name = "IDAmbiente";
IDAmbiente.ReadOnly = true;
IDAmbiente.Width = 49;
Cor.DataPropertyName = "Cor";
Cor.HeaderText = "Cor";
Cor.Name = "Cor";
Cor.ReadOnly = true;
Cor.Width = 77;
Descricao.DataPropertyName = "Descricao";
Descricao.HeaderText = "Descrição";
Descricao.Name = "Descricao";
Descricao.ReadOnly = true;
Descricao.Width = 77;
Descricao.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
colunasAdicionadas = true;
dtgDados.Columns.AddRange(new DataGridViewColumn[] {
IDAmbiente, Cor, Descricao
});
}
示例6: InitGridColumns
private void InitGridColumns(DateTime begin, DateTime end)
{
if (_DateColumns != null && _DateColumns.Count > 0)
{
foreach (DataGridViewColumn col in _DateColumns)
{
this.GridView.Columns.Remove(col);
}
_DateColumns.Clear();
}
while (end >= begin)
{
DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
col.Tag = begin;
col.Width = 30;
col.ReadOnly = true;
col.SortMode = DataGridViewColumnSortMode.NotSortable;
col.AutoSizeMode = DataGridViewAutoSizeColumnMode.NotSet;
col.HeaderText = begin.Day.ToString("D2");
if (HolidaySetting.Current != null && (HolidaySetting.Current.IsHoliday(begin) || HolidaySetting.Current.IsWeekend(begin)))
{
col.DefaultCellStyle.BackColor = Color.LightGray;
}
else
{
col.DefaultCellStyle.BackColor = Color.White;
}
_DateColumns.Add(col);
begin = begin.AddDays(1);
}
for (int i = 0; i < _DateColumns.Count; i++)
{
GridView.Columns.Insert(i + 1, _DateColumns[i]);
}
}
示例7: BindearDetalle
private void BindearDetalle()
{
// Initialize the DataGridView.
bsCotizacionDetalle.DataSource = new List<CotizacionDetalle>();
dgvCotizacion.AutoGenerateColumns = false;
dgvCotizacion.AllowUserToAddRows = false;
dgvCotizacion.AutoSize = true;
dgvCotizacion.DataSource = bsCotizacionDetalle;
// Initialize and add a text box column.
DataGridViewColumn column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "Renglon";
column.Name = "Renglon";
column.ReadOnly = true;
dgvCotizacion.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "CveArt";
column.Name = "Articulo";
column.ReadOnly = true;
dgvCotizacion.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "DescripcionArt";
column.Width = 150;
column.Name = "Descripcion";
column.ReadOnly = true;
dgvCotizacion.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "PresentacionArt";
column.Name = "Presentacion";
column.ReadOnly = true;
dgvCotizacion.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "Cantidad";
column.Name = "Cantidad";
column.ReadOnly = true;
dgvCotizacion.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "Precio";
column.Name = "Precio Unitario";
column.Width = 75;
column.ReadOnly = false;
dgvCotizacion.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "Marca";
column.Name = "Marca";
column.ReadOnly = false;
dgvCotizacion.Columns.Add(column);
column = new DataGridViewTextBoxColumn();
column.DataPropertyName = "Observaciones";
column.Name = "Observaciones";
column.ReadOnly = false;
dgvCotizacion.Columns.Add(column);
}
示例8: LoadAccounts
private void LoadAccounts()
{
accountGrid.Columns.Clear();
accountGrid.AutoGenerateColumns = false;
accountGrid.DataSource = null;
DataGridViewColumn realm = new DataGridViewTextBoxColumn();
realm.DataPropertyName = "Realm";
realm.Name = "Realm";
realm.HeaderText = "Realm";
accountGrid.Columns.Add(realm);
DataGridViewColumn Faction = new DataGridViewTextBoxColumn();
Faction.DataPropertyName = "Faction";
Faction.Name = "Faction";
Faction.HeaderText = "Faction";
accountGrid.Columns.Add(Faction);
DataGridViewColumn CharName = new DataGridViewTextBoxColumn();
CharName.DataPropertyName = "Name";
CharName.Name = "Name";
CharName.HeaderText = "Name";
accountGrid.Columns.Add(CharName);
DataGridViewColumn gold = new DataGridViewTextBoxColumn();
gold.DataPropertyName = "Gold";
gold.Name = "Gold";
gold.HeaderText = "Gold";
accountGrid.Columns.Add(gold);
}
示例9: dgvDataFormat
private void dgvDataFormat()
{
dgvData.Columns["ChkID"].Visible = false;
DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
col.Name = "自主檢查";
col.HeaderText = "自主檢查";
dgvData.Columns.Add(col);
dgvData.Columns["自主檢查"].DisplayIndex = 6;
for(int i = 0; i < dgvData.Rows.Count - 1; i++)
{
if (Convert.ToInt32(dgvData.Rows[i].Cells["ChkID"].Value) == 0)
{
dgvData.Rows[i].Cells["自主檢查"].Value = "首件";
}
else
{
dgvData.Rows[i].Cells["自主檢查"].Value = "製程中";
}
}
dgvData.Columns["日期"].Width = 145;
dgvData.Columns["料號"].Width = 100;
dgvData.Columns["版序"].Width = 60;
dgvData.Columns["批號"].Width = 100;
dgvData.Columns["層別"].Width = 60;
dgvData.Columns["數量"].Width = 60;
dgvData.Columns["檢驗數量"].Width = 90;
dgvData.Columns["氧化/水痕"].Width = 90;
dgvData.Columns["刮傷"].Width = 60;
dgvData.Columns["膜皺"].Width = 60;
dgvData.Columns["膜偏留邊"].Width = 90;
dgvData.Columns["板面氣泡"].Width = 90;
dgvData.Columns["判定"].Width = 60;
dgvData.Columns["檢驗人員"].Width = 90;
dgvData.Columns["備註"].Width = 150;
}
示例10: MazeGUI_Example
public MazeGUI_Example(int x, int y, int selfx, int selfy, int goalx, int goaly)
{
InitializeComponent();
Width = 60 + x * 25;
Height = 60 + y * 25;
for (int i = 0; i < x; i++)
{
DataGridViewColumn c = new DataGridViewTextBoxColumn();
c.Name = "" + i;
c.HeaderText = "" + i;
c.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
c.FillWeight = Math.Max(1, 100 / x);
grid.Columns.Add(c);
}
for (int i = 0; i < y; i++)
{
grid.Rows.Add("");
grid.Rows[i].HeaderCell.Value = "" + i;
}
SetSelf(selfx, selfy);
SetGoal(goalx, goaly);
KeyDown += (o, s) => { OK_Click(); };
grid.KeyDown += (o, s) => { OK_Click(); };
}
示例11: InitGrid
private void InitGrid()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmExport));
// add column thuoc
var clId = new DataGridViewTextBoxColumn { HeaderText = "Id", DataPropertyName = "Id", Name = "Id" };
clId.Visible = false;
grd.Columns.Add(clId);
var clType = new DataGridViewTextBoxColumn { HeaderText = "Nhập/Xuất kho", DataPropertyName = "TypeName", Name = "TypeName" };
grd.Columns.Add(clType);
var clmInStock = new DataGridViewTextBoxColumn { HeaderText = "Ngày nhập/xuất", DataPropertyName = "Date", Name = "Date" };
clmInStock.ReadOnly = true;
clmInStock.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
grd.Columns.Add(clmInStock);
var clmNo = new DataGridViewTextBoxColumn { HeaderText = "Mã chứng từ", DataPropertyName = "No", Name = "No" };
clmNo.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
grd.Columns.Add(clmNo);
var clmDeliverer = new DataGridViewTextBoxColumn { HeaderText = "Người giao", DataPropertyName = "Deliverer", Name = "Deliverer" };
clmDeliverer.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
grd.Columns.Add(clmDeliverer);
var clmNote = new DataGridViewTextBoxColumn { HeaderText = "Chú thích", DataPropertyName = "Note", Name = "Note" };
clmNote.ReadOnly = true;
clmNote.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
grd.Columns.Add(clmNote);
}
示例12: BuildDataGridViewStructure
private void BuildDataGridViewStructure()
{
dgvList.AllowUserToAddRows = false;
dgvList.MultiSelect = false;
dgvList.AllowUserToResizeRows = false;
dgvList.ReadOnly = true;
dgvList.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dgvList.AutoGenerateColumns = false;
DataGridViewTextBoxColumn id = new DataGridViewTextBoxColumn();
id.DisplayIndex = 0;
id.Name = "Id";
id.ReadOnly = true;
id.HeaderText = "Id";
id.DataPropertyName = "Id";
DataGridViewTextBoxColumn name = new DataGridViewTextBoxColumn();
name.DisplayIndex = 1;
name.Name = "Name";
name.ReadOnly = true;
name.HeaderText = "Name";
name.DataPropertyName = "Name";
DataGridViewCheckBoxColumn enabled = new DataGridViewCheckBoxColumn();
enabled.DisplayIndex = 2;
enabled.Name = "Enabled";
enabled.ReadOnly = true;
enabled.HeaderText = "Enabled";
enabled.DataPropertyName = "Enabled";
dgvList.Columns.AddRange(id, name, enabled);
}
示例13: createColumnDataGridView
public static void createColumnDataGridView(DataGridView dgvAgenda)
{
dgvAgenda.AutoGenerateColumns = false;
DataGridViewTextBoxColumn col = new DataGridViewTextBoxColumn();
col.DataPropertyName = "ag";
col.HeaderText = "object";
col.Width = 50;
col.Visible = false;
dgvAgenda.Columns.Add(col);
col = new DataGridViewTextBoxColumn();
col.DataPropertyName = "hour";
col.HeaderText = "Heure";
col.Width = 50;
dgvAgenda.Columns.Add(col);
col = new DataGridViewTextBoxColumn();
col.DataPropertyName = "Nom";
col.HeaderText = "Client";
col.Width = 140;
dgvAgenda.Columns.Add(col);
col = new DataGridViewTextBoxColumn();
col.DataPropertyName = "animal";
col.HeaderText = "Animal";
col.Width = 140;
dgvAgenda.Columns.Add(col);
col = new DataGridViewTextBoxColumn();
col.DataPropertyName = "race";
col.HeaderText = "Race";
col.Width = 80;
dgvAgenda.Columns.Add(col);
}
示例14: InitTodoMarkersGridView
private void InitTodoMarkersGridView(IList<ToDoMarker> markers)
{
TodoMarkersGridView.AutoGenerateColumns = false;
TodoMarkersGridView.Columns.Clear();
TodoMarkersGridView.DataSource = new BindingList<ToDoMarker>(markers);
TodoMarkersGridView.AlternatingRowsDefaultCellStyle.BackColor = Color.Lavender;
TodoMarkersGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
TodoMarkersGridView.CellValueChanged += SelectedPriorityChanged;
TodoMarkersGridView.ColumnHeaderMouseClick += SortColumn;
var markerTextColumn = new DataGridViewTextBoxColumn
{
Name = "Text",
DataPropertyName = "Text",
HeaderText = RubberduckUI.TodoSettings_Text,
ReadOnly = true
};
var markerPriorityColumn = new DataGridViewComboBoxColumn
{
Name = "Priority",
DataSource = TodoLabels(),
AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,
HeaderText = RubberduckUI.TodoSettings_Priority,
DataPropertyName = "PriorityLabel",
};
TodoMarkersGridView.Columns.AddRange(markerTextColumn, markerPriorityColumn);
}
示例15: InitGrid
private void InitGrid(bool isReadOnly)
{
var clId = new DataGridViewTextBoxColumn { HeaderText = "Id", DataPropertyName = "Id", Name = "Id" };
clId.Visible = false;
grd.Columns.Add(clId);
var clMedicineId = new DataGridViewTextBoxColumn { HeaderText = "Mã thuốc", DataPropertyName = "MedicineId", Name = "MedicineId" };
clMedicineId.Visible = false;
grd.Columns.Add(clMedicineId);
var clMedicineName = new DataGridViewTextBoxColumn { HeaderText = "Tên thuốc", DataPropertyName = "MedicineName", Name = "MedicineName" };
clMedicineName.ReadOnly = true;
grd.Columns.Add(clMedicineName);
var clInStock = new DataGridViewTextBoxColumn { HeaderText = "Số thuốc trong kho", DataPropertyName = "InStock", Name = "InStock" };
clInStock.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
clInStock.ReadOnly = true;
grd.Columns.Add(clInStock);
var clLastMonthUsage = new DataGridViewTextBoxColumn { HeaderText = "Số thuốc dùng tháng trước", DataPropertyName = "LastMonthUsage", Name = "LastMonthUsage" };
clLastMonthUsage.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
clLastMonthUsage.ReadOnly = true;
grd.Columns.Add(clLastMonthUsage);
var clCurrentMonthUsage = new DataGridViewTextBoxColumn { HeaderText = "Số thuốc tháng này đã dùng", DataPropertyName = "CurrentMonthUsage", Name = "CurrentMonthUsage" };
clCurrentMonthUsage.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
clCurrentMonthUsage.ReadOnly = true;
grd.Columns.Add(clCurrentMonthUsage);
var clRequired = new DataGridViewTextBoxColumn { HeaderText = "Số thuốc mong muốn", DataPropertyName = "Required", Name = "Required" };
clRequired.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
clRequired.ReadOnly = !isReadOnly;
grd.Columns.Add(clRequired);
}