本文整理汇总了C#中System.Windows.Forms.DataGridViewRow类的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewRow类的具体用法?C# DataGridViewRow怎么用?C# DataGridViewRow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridViewRow类属于System.Windows.Forms命名空间,在下文中一共展示了DataGridViewRow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ApplicationControl_Load
private void ApplicationControl_Load(object sender, System.EventArgs e)
{
Action<string> Add =
text =>
{
var r = new DataGridViewRow();
r.Cells.AddText(text);
this.dataGridView1.Rows.Add(r);
};
Add("foo1");
Add("foo2");
Add("foo3");
Add("foo4");
Add("foo5");
int i = 5;
button2.Click +=
delegate
{
i++;
Add("foox " + i);
};
}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:27,代码来源:ApplicationControl.cs
示例2: ShowItemInGridViewRow
protected override void ShowItemInGridViewRow(DataGridViewRow row, object item)
{
Role info = item as Role;
row.Tag = item;
row.Cells["colName"].Value = info.Name;
row.Cells["colMemo"].Value = info.Memo;
}
开发者ID:ljh198275823,项目名称:516-ZhinengChaoBiao,代码行数:7,代码来源:FrmRoleMaster.cs
示例3: RowToReplacement
private static Replacement RowToReplacement(DataGridViewRow dataGridRow)
{
Replacement rep = new Replacement
{
Enabled = ((bool)dataGridRow.Cells["enabled"].FormattedValue),
Minor = ((bool)dataGridRow.Cells["minor"].FormattedValue),
IsRegex = ((bool)dataGridRow.Cells["regex"].FormattedValue),
BeforeOrAfter = ((bool)dataGridRow.Cells["BeforeOrAfter"].FormattedValue)
};
if (dataGridRow.Cells["replace"].Value == null)
dataGridRow.Cells["replace"].Value = "";
string f = Encode(dataGridRow.Cells["find"].Value.ToString());
string r = Encode(dataGridRow.Cells["replace"].Value.ToString());
if (!rep.IsRegex)
f = Regex.Escape(f);
rep.Find = f;
rep.Replace = r;
if (!(bool)dataGridRow.Cells["casesensitive"].FormattedValue)
rep.RegularExpressionOptions |= RegexOptions.IgnoreCase;
if ((bool)dataGridRow.Cells["multi"].FormattedValue)
rep.RegularExpressionOptions |= RegexOptions.Multiline;
if ((bool)dataGridRow.Cells["single"].FormattedValue)
rep.RegularExpressionOptions |= RegexOptions.Singleline;
rep.Comment = (string)dataGridRow.Cells["comment"].FormattedValue ?? "";
return rep;
}
开发者ID:svn2github,项目名称:autowikibrowser,代码行数:35,代码来源:FindandReplace.cs
示例4: ResultTable
public ResultTable(DataGridView dataView, string[] names) // constructor. Uses array of names for column/row header labels
{
m_dataView = dataView;
m_results = new Result[m_numberOfSequences, m_numberOfSequences];
for (int i = 0; i < m_numberOfSequences; ++i)
{
DataGridViewTextBoxColumn column = new DataGridViewTextBoxColumn();
column.HeaderText = "seq" + (i+1);
column.MaxInputLength = 8;
column.Width = 50;
DataGridViewCell cell = new DataGridViewTextBoxCell();
column.CellTemplate = cell;
m_dataView.Columns.Add(column);
}
for (int j = 0; j < m_numberOfSequences; ++j)
{
DataGridViewRow row = new DataGridViewRow(); // how can I remove the dumb current cell pointer that makes the header cells so big/obfuscates the header text?
row.HeaderCell.Value = "seq"+(j+1);
row.Height = 20;
for (int i = 0; i < m_numberOfSequences; ++i)
{
DataGridViewCell cell = new DataGridViewTextBoxCell();
row.Cells.Add(cell);
}
dataView.RowHeadersWidthSizeMode=DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
m_dataView.Rows.Add(row);
}
dataView.CurrentCell = null;
}
开发者ID:YazanHalawa,项目名称:CS-312,代码行数:30,代码来源:ResultTable.cs
示例5: ConseguirDatosToUpdate
public void ConseguirDatosToUpdate(Control controles, DataGridViewRow fila)
{
ctrlID.Text = fila.Cells[0].Value.ToString();
ctrlNombre.Text = fila.Cells[1].Value.ToString();
ctrlApellido.Text = fila.Cells[2].Value.ToString();
if (fila.Cells[3].Value.ToString() == "Femenino")
{
((RadioButton)ctrlGeneroM).Checked = false;
((RadioButton)ctrlGeneroF).Checked = true;
}
else
{
((RadioButton)ctrlGeneroM).Checked = true;
((RadioButton)ctrlGeneroF).Checked = false;
}
ctrlFechaNacimiento.Text = fila.Cells[4].Value.ToString();
ctrlFechaInicio.Text = fila.Cells[5].Value.ToString();
ctrlTelefono.Text = fila.Cells[6].Value.ToString();
ctrlEmail.Text = fila.Cells[7].Value.ToString();
ctrlHoras.Text = fila.Cells[8].Value.ToString();
ctrlInformacion.Text = fila.Cells[9].Value.ToString();
}
开发者ID:razor777,项目名称:Bencaleth,代码行数:25,代码来源:Voluntarios.cs
示例6: DgvDeleteCommand
public DgvDeleteCommand( DgvHandler dgvHandler, DataGridViewRow row )
: base(dgvHandler)
{
Init();
this.row = row;
this.curRowIndex = row.Index;
}
开发者ID:JackyDing,项目名称:EnvMan,代码行数:7,代码来源:DgvDeleteCommand.cs
示例7: ActualizarHorarioEnGrilla
// actualiza fila en grilla
private void ActualizarHorarioEnGrilla(DataGridViewRow row, Horario horario)
{
int indice = row.Index;
QuitarHorarioDeGrilla(row);
DataGridViewRow newRow = ConstruirRow(horario);
dataGridViewHorarios.Rows.Insert(indice, newRow);
}
开发者ID:andrescabrera,项目名称:LenguajesVisualesI,代码行数:8,代码来源:ListaHorarios.cs
示例8: FillRow
protected override DataGridViewRow FillRow(Report entity, DataGridViewRow rowToAdd)
{
rowToAdd.Cells.Add(new DataGridViewTextBoxCell {Value = entity.Id});
rowToAdd.Cells.Add(new DataGridViewTextBoxCell {Value = entity.DateTime.ToPersianDateString()});
rowToAdd.Cells.Add(new DataGridViewTextBoxCell {Value = entity.Title});
return rowToAdd;
}
开发者ID:mortezaraeisi,项目名称:Basim,代码行数:7,代码来源:ListOfReportsForm.cs
示例9: AddItems
private void AddItems(string[] panels, int sections)
{
foreach (string panel in panels)
{
DataGridViewComboBoxCell reff = new DataGridViewComboBoxCell();
DataGridViewTextBoxCell txt2A = new DataGridViewTextBoxCell();
DataGridViewRow dataGridRow = new DataGridViewRow();
//ComboBox reff = new ComboBox();
reff.MaxDropDownItems = sections;
//reff.DataSource =
txt2A.Value = panel;
for (int i = 1; i <= sections; i++)
reff.Items.Add(i);
try
{
dataGridRow.Cells.Add(txt2A);
dataGridRow.Cells.Add(reff);
Grid.Rows.Add(dataGridRow);
}
catch (Exception e)
{
MessageBox.Show(e.Message, "Error");
}
}
}
开发者ID:GMTurbo,项目名称:Free-Form-Matcher,代码行数:25,代码来源:MessageDropDownBox.cs
示例10: FilterPropertiesDlg_Load
private void FilterPropertiesDlg_Load(object sender, EventArgs e)
{
// заполняем таблицу
foreach (var item in filter.ColumnFilters.Values.ToList())
{
var row = new DataGridViewRow();
row.Cells.Add(new DataGridViewTextBoxCell { Value = item.PropInfo.Name });
row.Cells.Add(new DataGridViewTextBoxCell { Value = item.Title });
if (item.EnabledValues.Length > 0)
{
var valueCol = new DataGridViewComboBoxCell();
valueCol.Items.AddRange(item.EnabledValues.ToArray());
row.Cells.Add(valueCol);
}
else
row.Cells.Add(new DataGridViewTextBoxCell {Value = item.Value ?? string.Empty});
var criteriasCol = new DataGridViewComboBoxCell();
criteriasCol.Items.AddRange(item.GetStringCriterias());
if (item.Criterias != ColumnFilterCriteria.Нет)
criteriasCol.Value = item.Criterias.ToString();
else
criteriasCol.Value = criteriasCol.Items[0];
row.Cells.Add(criteriasCol);
grid.Rows.Add(row);
}
}
开发者ID:johnmensen,项目名称:TradeSharp,代码行数:29,代码来源:FilterPropertiesDlg.cs
示例11: getDataGridViewRow
public DataGridViewRow getDataGridViewRow(DataGridView dg, KeeperTracker mt)
{
DataGridViewRow row = new DataGridViewRow();
row.CreateCells(dg);
string dgIdentifier = this.ident.ToString("X").PadLeft(8, '0') + "h";
string dgRemoteRequest = (this.remote_request?"Yes":"No");
string dgLength = this.data_length.ToString();
string dgData = byteArrayToHexString(this.data, this.data_length);
string dgPeriod = mt.getPeriod(this).ToString();
string dgCount = mt.getCount(this).ToString();
string dgTime = mt.getTime(this).ToLongTimeString();
ArrayList a = new ArrayList();
a.Add(dgIdentifier);
a.Add(dgRemoteRequest);
a.Add(dgLength);
a.Add(dgData);
a.Add(dgPeriod);
a.Add(dgCount);
a.Add(dgTime);
a.Add(this.ident);
a.Add(this);
row.SetValues(a.ToArray());
return row;
}
开发者ID:Cougar,项目名称:HomeAutomation,代码行数:27,代码来源:canMessage.cs
示例12: Registro
public Registro(DataGridViewRow fila,int cualRegistro)
{
InitializeComponent();
switch (cualRegistro)
{
//Alcancias
case 0:
Herramientas.AbrirEnContainerNewForm(new IngresoAlcancia(fila), splitContainer1.Panel1);
break;
//Empleados
case 1:
Herramientas.AbrirEnContainerNewForm(new IngresoEmpleados(fila),splitContainer1.Panel1);
break;
//Empresas
case 2:
Herramientas.AbrirEnContainerNewForm(new IngresarEmpresa(fila), splitContainer1.Panel1);
break;
//Ninos
case 3:
Herramientas.AbrirEnContainerNewForm(new IngresoNiños(fila), splitContainer1.Panel1);
break;
//Padrinos
case 4:
Herramientas.AbrirEnContainerNewForm(new IngresoPadrinos(fila), splitContainer1.Panel1);
break;
//Voluntarios
case 5:
Herramientas.AbrirEnContainerNewForm(new IngresoVoluntarios(fila), splitContainer1.Panel1);
break;
default:
break;
}
}
开发者ID:leoderas,项目名称:Bencaleth,代码行数:34,代码来源:Registro.cs
示例13: DgvBrowseFolderCommand
public DgvBrowseFolderCommand(DgvHandler dgvHandler, DataGridViewRow row)
: base(dgvHandler)
{
Init();
currentRow = CloneRow(row);
curRowIndex = row.Index;
}
开发者ID:JackyDing,项目名称:EnvMan,代码行数:7,代码来源:DgvBrowseFolderCommand.cs
示例14: ApplicationControl_Load
private void ApplicationControl_Load(object sender, System.EventArgs e)
{
var rr = this.dataGridView1.Rows.Count;
for (int i = 0; i < 7; i++)
{
var r = new DataGridViewRow();
r.Height = 60;
for (int j = 0; j < 7; j++)
{
r.Cells.AddRange(
new DataGridViewTextBoxCell
{
Value = "world #" + i + "," + j
}
);
}
this.dataGridView1.Rows.AddRange(r);
}
}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:26,代码来源:ApplicationControl.cs
示例15: FillInvoiceGrid
// *********** function to fill tha INVOICE GRID VIEW ***************
public void FillInvoiceGrid()
{
if (vehical_category_data.qty != "")
{
DataGridViewRow NewRow = new DataGridViewRow();
grdBill.Rows.Add(NewRow);
int a = grdBill.RowCount;
int catID = vehical_category_data.get_catagory_id();
string brand = vehical_category_data.brand;
string size = vehical_category_data.size;
string qty = vehical_category_data.qty;
string unitPrice = vehical_category_data.unitPrice;
double linePrice = Convert.ToDouble(vehical_category_data.unitPrice) * Convert.ToDouble(vehical_category_data.qty);
grdBill.Rows[a - 1].Cells[0].Value = catID.ToString();
grdBill.Rows[a - 1].Cells[1].Value = brand + " / " + size;
grdBill.Rows[a - 1].Cells[2].Value = qty;
grdBill.Rows[a - 1].Cells[3].Value = unitPrice;
grdBill.Rows[a - 1].Cells[4].Value = linePrice.ToString();
grdBill.Rows[a - 1].Cells[5].Value = "V"; ;
//to calculate invoice total
//uses total at vehical_category_data class
vehical_category_data.total = linePrice + vehical_category_data.total;
txtTotal.Text = vehical_category_data.total.ToString();
vehical_category_data.statusPass2Forms = false;
}
}
开发者ID:CRISTELSoftware,项目名称:CRISTEL-DHANULA,代码行数:31,代码来源:Billing.cs
示例16: frmMain
public frmMain()
{
InitializeComponent();
LoadConfig();
nudPort.Value = (Decimal)httpPort;
edHost.Text = tvServerHost;
nudWidth.Value = thumbWidth;
nudHeight.Value = thumbHeight;
edPlayer.Text = clientPlayer;
edUid.Text = uid;
edPwd.Text = pwd;
cbPlayerType.SelectedIndex = playerType;
foreach (EncoderConfig cfg in encCfgs)
{
DataGridViewRow row = new DataGridViewRow();
row.CreateCells(grid);
row.Cells[0].Value = cfg.displayName;
row.Cells[1].Value = cfg.useTranscoding;
row.Cells[2].Value = cfg.fileName;
row.Cells[3].Value = cfg.args;
row.Cells[4].Value = cfg.inputMethod.ToString();
row.Cells[5].Value = cfg.outputMethod.ToString();
grid.Rows.Add(row);
}
grid.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
}
开发者ID:oxan,项目名称:mpwebservices,代码行数:26,代码来源:frmMain.cs
示例17: butConnect_Click
private void butConnect_Click(object sender, EventArgs e)
{
if (_Connected)
{
if (_Thread != null)
{
_Thread.Abort();
_Thread = null;
}
_Connected = false;
butConnect.Text = "Connect";
butRecord.Enabled = false;
cbSharedMemName.Enabled = true;
DataGridViewRow row = new DataGridViewRow();
if (dgMessages.Rows.Count > 0)
{
var first = dgMessages.Rows[dgMessages.Rows.GetFirstRow(DataGridViewElementStates.None)].Cells[0];
row.Cells.Add(new DataGridViewTextBoxCell() { Value = first.Value });
}
else
{
row.Cells.Add(new DataGridViewTextBoxCell() { Value = "0" });
}
row.Cells.Add(new DataGridViewTextBoxCell() { Value = "" });
row.Cells.Add(new DataGridViewTextBoxCell() { Value = "" });
row.Cells.Add(new DataGridViewTextBoxCell() { Value = "" });
row.Cells.Add(new DataGridViewTextBoxCell() { Value = "" });
row.Cells.Add(new DataGridViewTextBoxCell() { Value = "Disconnected from server" });
row.Cells.Add(new DataGridViewTextBoxCell() { Value = "" });
row.DefaultCellStyle.ForeColor = Color.Red;
dgMessages.Rows.Insert(0, row);
}
else
{
if (_Thread == null)
{
var name = cbSharedMemName.Text;
_Thread = new Thread(() => {
Connect(name);
});
_Thread.IsBackground = true;
_Thread.Start();
}
dgMessages.Rows.Clear();
butConnect.Text = "Connecting...";
butConnect.Enabled = false;
cbSharedMemName.Enabled = false;
}
}
开发者ID:Translator5,项目名称:desura-app,代码行数:60,代码来源:Form1.cs
示例18: ShowItemInGridViewRow
protected override void ShowItemInGridViewRow(DataGridViewRow row, object item)
{
VacationType VacationType = item as VacationType;
row.Tag = VacationType;
row.Cells["colName"].Value = VacationType.Name;
row.Cells["colMemo"].Value = VacationType.Memo;
}
开发者ID:chendeben,项目名称:508-Attendance,代码行数:7,代码来源:FrmVacationTypeMaster.cs
示例19: OnPrimaryKeyChangedComplete
protected override void OnPrimaryKeyChangedComplete(Exception error)
{
if (error != null)
{
RTOut.WriteError(error);
throw error;
}
dgvUDT.Rows.Clear();
List<string> udtNames = new List<string>();
foreach (XElement each in UDT.Elements("TableName"))
udtNames.Add(each.Value);
udtNames.Sort();
foreach (string each in udtNames)
{
DataGridViewRow row = new DataGridViewRow();
row.CreateCells(dgvUDT, each);
dgvUDT.Rows.Add(row);
}
}
开发者ID:ischool-desktop,项目名称:KHJH_CentralOffice,代码行数:26,代码来源:UDTItem.cs
示例20: AddElementToDataGridView
private void AddElementToDataGridView(Param element)
{
var row = new DataGridViewRow();
// пустая сточка означет разделитель между
// отдельными интерфейсами
if(element.ParamName == string.Empty)
{
dataGridView1.Rows.Add(row);
return;
}
// добавляем первую ячейку
var cell1 = new DataGridViewTextBoxCell()
{
Value = element.ParamName + ":"
};
cell1.Style.Font = new Font(dataGridView1.Font, FontStyle.Bold);
row.Cells.Add(cell1);
// добавляем вторую ячейку
var cell2 = new DataGridViewTextBoxCell()
{
Value = element.ParamValue
};
row.Cells.Add(cell2);
// добавляем строчку в dataGridView
dataGridView1.Rows.Add(row);
}
开发者ID:nemocaptm,项目名称:Mashine-side,代码行数:30,代码来源:CPU.cs
注:本文中的System.Windows.Forms.DataGridViewRow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论