本文整理汇总了C#中System.Windows.Forms.DataGridViewEditingControlShowingEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewEditingControlShowingEventArgs类的具体用法?C# DataGridViewEditingControlShowingEventArgs怎么用?C# DataGridViewEditingControlShowingEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataGridViewEditingControlShowingEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了DataGridViewEditingControlShowingEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dataGridViewDistances_EditingControlShowing
private void dataGridViewDistances_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
var textbox = (TextBox)e.Control;
if (dataGridViewDistances.CurrentCell.ColumnIndex != 0)
{
textbox.AutoCompleteMode = AutoCompleteMode.None;
return;
}
textbox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
textbox.AutoCompleteSource = AutoCompleteSource.CustomSource;
var items = new AutoCompleteStringCollection();
var enteredSystems = GetEnteredSystems();
items.AddRange((
from s
in SystemData.SystemList
where s.HasCoordinate && (s.name == textbox.Text || !enteredSystems.Contains(s))
orderby s.name ascending
select s.name
).ToArray());
textbox.AutoCompleteCustomSource = items;
}
示例2: dataGridView1_EditingControlShowing
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
ComboBox combo = e.Control as ComboBox;
if (combo != null)
{
combo.SelectedIndexChanged -= new EventHandler(ComboBox_SelectedIndexChanged);
combo.SelectedIndexChanged += new EventHandler(ComboBox_SelectedIndexChanged);
}
TextBox tx = e.Control as TextBox;
DataGridViewTextBoxCell cell = dataGridView1.CurrentCell as DataGridViewTextBoxCell;
if (tx != null && cell.OwningColumn == dataGridView1.Columns["ColRate"])
{
tx.TextChanged -= new EventHandler(txtRate_TextChanged);
tx.TextChanged += new EventHandler(txtRate_TextChanged);
}
if (tx != null && cell.OwningColumn == dataGridView1.Columns["ColQTY"])
{
tx.TextChanged -= new EventHandler(txtQty_TextChanged);
tx.TextChanged += new EventHandler(txtQty_TextChanged);
}
if (tx != null && cell.OwningColumn == dataGridView1.Columns["txtScheme"])
{
tx.TextChanged -= new EventHandler(txtScheme_TextChanged);
tx.TextChanged += new EventHandler(txtScheme_TextChanged);
}
}
示例3: indexGrid_EditingControlShowing
private void indexGrid_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
Type t = e.Control.GetType();
if (t != typeof(DataGridViewComboBoxEditingControl)) return;
DataGridViewComboBoxEditingControl ec = e.Control as DataGridViewComboBoxEditingControl;
ec.DrawMode = DrawMode.OwnerDrawFixed;
ec.DrawItem += new DrawItemEventHandler(dropdown_DrawItem);
if (indexGrid.CurrentCell.ColumnIndex == 0)
{
// now we need to set the item list to all non used columns and the option of
// NONE
ec.Items.Clear();
ec.Items.Add("<None>");
foreach (string s in columnNames)
{
bool alreadyUsed = false;
if (s != (string)indexGrid.CurrentRow.Cells[0].Value)
foreach (IndexColumnGridRow row in gridRows)
if (row.ColumnName == s)
{
alreadyUsed = true;
break;
}
if (!alreadyUsed)
ec.Items.Add(s);
}
int index = ec.FindStringExact(indexGrid.CurrentRow.Cells[0].Value as string);
if (index > 0)
ec.SelectedIndex = index;
}
}
示例4: GRD_EditingControlShowing
void GRD_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (e.Control is DurationInputBoxEditingControl)
{
durationInputBox = GRD.EditingControl as DurationInputBox;
}
}
示例5: dataGridView_EditingControlShowing
private void dataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) {
_ShipCombo = e.Control as ComboBox;
if (_ShipCombo != null) {
_ShipCombo.DropDownStyle = ComboBoxStyle.Simple;
_ShipCombo.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
_ShipCombo.AutoCompleteSource = AutoCompleteSource.ListItems;
}
}
示例6: dataGridView1_EditingControlShowing
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (dataGridView1.CurrentCell.ColumnIndex == 0)
{
TextBox tb = e.Control as TextBox;
tb.KeyPress += new KeyPressEventHandler(tb_KeyPress);
}
}
示例7: dataGridView1_EditingControlShowing
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (e.Control.GetType().BaseType.Name == "TextBox")
{
control = (TextBox)e.Control;
//需要限制输入数字的单元格
control.KeyPress += new KeyPressEventHandler(validating_KeyPress);
}
}
示例8: cartDataGridView_EditingControlShowing
private void cartDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
ComboBox combo = e.Control as ComboBox;
if (combo != null)
{
combo.SelectedIndexChanged -= new EventHandler(ComboBox_SelectedIndexChanged);
combo.SelectedIndexChanged += new EventHandler(ComboBox_SelectedIndexChanged);
}
}
示例9: DirectoryCmdView_EditingControlShowing
private void DirectoryCmdView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
DataGridViewComboBoxEditingControl comboControl = e.Control as DataGridViewComboBoxEditingControl;
if (comboControl != null) {
// Set the DropDown style to get an editable ComboBox
if (comboControl.DropDownStyle != ComboBoxStyle.DropDown) {
comboControl.DropDownStyle = ComboBoxStyle.DropDown;
}
}
}
示例10: dgvLineaCompra_EditingControlShowing
private void dgvLineaCompra_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
dgvCombo = e.Control as DataGridViewComboBoxEditingControl;
if (dgvCombo != null)
{
dgvCombo.SelectedIndexChanged += new EventHandler(dgvLineaCompra_SelectedIndexChanged);
}
}
示例11: dgvCellEditing
public static void dgvCellEditing(DataGridView dgv,string columnName, DataGridViewEditingControlShowingEventArgs e)
{
if (dgv.CurrentCell != null && dgv.CurrentCell.ColumnIndex == dgv.Columns[columnName].Index)
{
Control cntObject = new Control();
e.Control.TextChanged += new EventHandler((object sse, EventArgs se) => Utilities.Cell_TextChanged(sse, dgv, cntObject));
cntObject = e.Control;
cntObject.TextChanged += (object sse, EventArgs se) => Utilities.Cell_TextChanged(sse, dgv, cntObject);
}
dgv.RefreshEdit();
}
示例12: bonusDataGridView_EditingControlShowing
private void bonusDataGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
e.Control.KeyPress -= new KeyPressEventHandler(Column1_KeyPress);
if ((bonusDataGridView.CurrentCell.ColumnIndex == 4)|| (bonusDataGridView.CurrentCell.ColumnIndex == 5))
{
TextBox tb = e.Control as TextBox;
if (tb != null)
{
tb.KeyPress += new KeyPressEventHandler(Column1_KeyPress);
}
}
}
示例13: grvStock_EditingControlShowing
private void grvStock_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
if (e.Control is DataGridViewTextBoxEditingControl)
{
DataGridViewTextBoxEditingControl txtBox = (DataGridViewTextBoxEditingControl)e.Control;
txtBox.KeyPress -= new KeyPressEventHandler(Control_KeyPress);
if (this.grvStock.CurrentCell.OwningColumn.Index == indexQTY)
{
txtBox.KeyPress += new KeyPressEventHandler(Control_KeyPress);
}
}
}
示例14: dgvManualStatVarProps_EditingControlShowing
/// <summary>
/// Handler for when edits occur to statvarcombobox
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void dgvManualStatVarProps_EditingControlShowing(object sender,
DataGridViewEditingControlShowingEventArgs e)
{
ComboBox mComboBox = e.Control as ComboBox;
if (mComboBox != null)
{
mComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
//mComboBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
//mComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
mComboBox.SelectionChangeCommitted -= OnSelectStatVarLevel;
mComboBox.SelectionChangeCommitted += OnSelectStatVarLevel;
};
}
示例15: dgv_list_EditingControlShowing
private void dgv_list_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
ComboBox cb = e.Control as ComboBox;
if (cb != null)
{
// first remove event handler to keep from attaching multiple:
cb.SelectedIndexChanged -= new
EventHandler(cb_SelectedIndexChanged);
// now attach the event handler
cb.SelectedIndexChanged += new
EventHandler(cb_SelectedIndexChanged);
}
}