本文整理汇总了C#中System.Windows.Forms.DataGridViewColumnEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewColumnEventArgs类的具体用法?C# DataGridViewColumnEventArgs怎么用?C# DataGridViewColumnEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridViewColumnEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了DataGridViewColumnEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: keyDataGridView_ColumnAdded
void keyDataGridView_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
{
e.Column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
if (e.Column.DataPropertyName == "Confirm" || e.Column.DataPropertyName == "Lifetime") {
e.Column.Visible = false;
}
}
示例2: dataGridView_ColumnRemoved
private void dataGridView_ColumnRemoved(object sender, DataGridViewColumnEventArgs e)
{
if ((e.Column != null) && !e.Column.IsDataBound)
{
e.Column.DisplayIndex = -1;
}
}
示例3: OnColumnAdded
protected override void OnColumnAdded(DataGridViewColumnEventArgs e)
{
base.OnColumnAdded(e);
e.Column.HeaderCell.ContextMenuStrip = menuColumnHeader;
MenuOpening(null, new CancelEventArgs());
}
示例4: dgv_ColumnWidthChanged
private void dgv_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
{
int index = dgv.Columns.IndexOf(e.Column);
if (index == -1)
return;
var col = _schema[index];
col.Width = e.Column.Width;
}
示例5: AuditGridView_ColumnAdded
//Makes the print column selectable, and keeps other columns readonly
private void AuditGridView_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
{
DataGridViewColumn column = e.Column;
column.ReadOnly = true;
if (column.Name == "print")
{
column.ReadOnly = false;
}
}
示例6: connectionsDataGridView_ColumnDisplayIndexChanged
private void connectionsDataGridView_ColumnDisplayIndexChanged(object sender, DataGridViewColumnEventArgs e)
{
if (!m_start)
{
m_Settings["connectionsIconIndex"] = connectionsDataGridView.Columns["Icon"].DisplayIndex.ToString();
m_Settings["connectionsIPAddressIndex"] = connectionsDataGridView.Columns["IPAddress"].DisplayIndex.ToString();
m_Settings["connectionsPortIndex"] = connectionsDataGridView.Columns["Port"].DisplayIndex.ToString();
m_Settings["connectionsSentIndex"] = connectionsDataGridView.Columns["Sent"].DisplayIndex.ToString();
m_Settings["connectionsReceivedIndex"] = connectionsDataGridView.Columns["Received"].DisplayIndex.ToString();
m_Settings["connectionsSentCommandsIndex"] = connectionsDataGridView.Columns["SentCommands"].DisplayIndex.ToString();
m_Settings["connectionsReceivedCommandsIndex"] = connectionsDataGridView.Columns["ReceivedCommands"].DisplayIndex.ToString();
m_Settings["connectionsEnqueuedCommandsIndex"] = connectionsDataGridView.Columns["EnqueuedCommands"].DisplayIndex.ToString();
}
}
示例7: SpreadsheetView_ColumnWidthChanged
void SpreadsheetView_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
{
int col = e.Column.Index;
SpreadsheetModel model = spreadsheetModel;
for (int i = 0; i < RowCount; i++)
{
Cell cell = model.Cells[i, col];
if (cell == null)
{
cell = new Cell();
model.Cells[i,col] = cell;
}
cell.CellFormat.CellWidth = this.Columns[col].Width;
}
}
示例8: ShipView_ColumnWidthChanged
// 列のサイズ変更関連
private void ShipView_ColumnWidthChanged( object sender, DataGridViewColumnEventArgs e )
{
if ( IsRowsUpdating )
return;
var group = CurrentGroup;
if ( group != null ) {
if ( !group.ViewColumns[e.Column.Name].AutoSize ) {
group.ViewColumns[e.Column.Name].Width = e.Column.Width;
}
}
}
示例9: ScannerViewColumnWidthChanged
private void ScannerViewColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
{
ScannerViewUpdateHeaderCheckBoxPos();
}
示例10: fDataPreview_ColumnWidthChanged
private void fDataPreview_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
{
if (this.checkColumnsWidth && fDataPreview.Columns.Count > 0)
{
if (!this.justUpdated)
{
int width = fDataPreview.Columns.GetColumnsWidth(DataGridViewElementStates.Visible);
if (width < 682)
{
this.justUpdated = true;
fDataPreview.Columns[fDataPreview.Columns.Count - 1].Width += 682 - width;
}
}
else
{
this.justUpdated = false;
}
}
}
示例11: DataGridView_ColumnSortModeChanged
/// <summary>
/// Throws an exception when the column sort mode is changed to Automatic.
/// </summary>
/// <param name="sender">The object that raised the event.</param>
/// <param name="e">A DataGridViewColumnEventArgs that contains the event data.</param>
private void DataGridView_ColumnSortModeChanged(object sender, DataGridViewColumnEventArgs e)
{
if (e.Column == OwningColumn &&
e.Column.SortMode == DataGridViewColumnSortMode.Automatic)
{
throw new InvalidOperationException(
"A SortMode value of Automatic is incompatible with " +
"the DataGridViewAutoFilterColumnHeaderCell type. " +
"Use the AutomaticSortingEnabled property instead.");
}
}
示例12: dgvcallups_ColumnAdded
private void dgvcallups_ColumnAdded(object sender, DataGridViewColumnEventArgs e)
{
//if (e.Column.Index == 9)
//{
// _coladded = true;
// dgvcallups.Rows[_newAddedRowIndex].Cells[1].Value = " ";
// dgvcallups.Rows[_newAddedRowIndex].Cells[2].Value = " ";
// dgvcallups.Rows[_newAddedRowIndex].Cells[3].Value = " ";
// dgvcallups.Rows[_newAddedRowIndex].Cells[4].Value = " ";
// dgvcallups.Rows[_newAddedRowIndex].Cells[5].Value = false;
// dgvcallups.Rows[_newAddedRowIndex].Cells[6].Value = false;
// dgvcallups.Rows[_newAddedRowIndex].Cells[7].Value = false;
// dgvcallups.Rows[_newAddedRowIndex].Cells[8].Value = "";
// dgvcallups.Rows[_newAddedRowIndex].Cells[9].Value = true;
// dgvcallups.RefreshEdit();
// dgvcallups.Refresh();
//}
}
示例13: OnColumnRemoved
protected virtual void OnColumnRemoved (DataGridViewColumnEventArgs e)
{
DataGridViewColumnEventHandler eh = (DataGridViewColumnEventHandler)(Events [ColumnRemovedEvent]);
if (eh != null)
eh (this, e);
}
示例14: OnColumnWidthChanged
/// ------------------------------------------------------------------------------------
/// <summary>
/// Raises the <see cref="E:System.Windows.Forms.DataGridView.ColumnWidthChanged"/>
/// event.
/// </summary>
/// <param name="e">A <see cref="T:System.Windows.Forms.DataGridViewColumnEventArgs"/>
/// that contains the event data.</param>
/// <exception cref="T:System.ArgumentException">The column indicated by the
/// <see cref="P:System.Windows.Forms.DataGridViewColumnEventArgs.Column"/> property of
/// e does not belong to this <see cref="T:System.Windows.Forms.DataGridView"></see>
/// control.</exception>
/// ------------------------------------------------------------------------------------
protected override void OnColumnWidthChanged(DataGridViewColumnEventArgs e)
{
base.OnColumnWidthChanged(e);
if (e.Column.Width == DataGridViewControlColumn.kMinimumValue && m_fFullyInitialized &&
((DataGridViewControlColumn)e.Column).IsCollapsible)
{
// user dragged the divider all the way to the left, so we will hide the column
m_ColumnsAndRowsToHide.Add(e.Column);
}
}
示例15: dataGridViewHeader_ColumnWidthChanged
/*************************************************************
* データグリッドビュー(ヘッダー)の列幅変更に伴う処理
*************************************************************/
private new void dataGridViewHeader_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
{
base.DataGridView = this.dataGridView;
base.DataGridViewTotal = this.dataGridViewTotal;
base.DataGridViewHeader = this.dataGridViewHeader;
base.dataGridViewHeader_ColumnWidthChanged(sender, e);
}