当前位置: 首页>>代码示例>>C#>>正文


C# Forms.DataGridViewEditingControlShowingEventArgs类代码示例

本文整理汇总了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;
        }
开发者ID:lukepfeiffer10,项目名称:EDDiscovery,代码行数:25,代码来源:TrilaterationControl.cs

示例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);
     }
 }
开发者ID:Chitra89,项目名称:Totals,代码行数:26,代码来源:EstimateBill.cs

示例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;
            }
        }
开发者ID:elevate,项目名称:mysqlconnector-.net,代码行数:33,代码来源:IndexColumnEditorDialog.cs

示例4: GRD_EditingControlShowing

 void GRD_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
 {
     if (e.Control is DurationInputBoxEditingControl)
     {
         durationInputBox = GRD.EditingControl as DurationInputBox;
     }
 }
开发者ID:Veivan,项目名称:GanttDll,代码行数:7,代码来源:ucTasks.cs

示例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;
     }
 }
开发者ID:CzBuCHi,项目名称:eve-intel-map,代码行数:8,代码来源:IntelGrid.cs

示例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);
     }
 }
开发者ID:JiangJunGG,项目名称:SyAutoH,代码行数:8,代码来源:Form1.cs

示例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);
     }
 }
开发者ID:bearxiong99,项目名称:DistributionLineFaultIndicator,代码行数:9,代码来源:IndtrAddrLocal.cs

示例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);
            }
        }
开发者ID:senthilmmurugesan,项目名称:ECommerce_Desktop_Application,代码行数:10,代码来源:frmCart.cs

示例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;
         }
     }
 }
开发者ID:Dekken,项目名称:buildatron,代码行数:10,代码来源:MainForm.cs

示例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);
            }

        }
开发者ID:4riel,项目名称:recursos.csharp,代码行数:10,代码来源:frmCompra.cs

示例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();
 }
开发者ID:Hli4S,项目名称:TestMeApp,代码行数:11,代码来源:Utilities.cs

示例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);
         }
     }
 }
开发者ID:atan888,项目名称:MMS,代码行数:12,代码来源:BonusDialog.cs

示例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);
         }
     }
 }
开发者ID:SoftSuite,项目名称:ABB,代码行数:12,代码来源:ProductStock.cs

示例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;
     };
 }
开发者ID:runarbe,项目名称:Avinet.Adaptive.Statistics.ExcelAddIn,代码行数:18,代码来源:UploadForm.StatVarGrid.cs

示例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);
            }
        }
开发者ID:core1011,项目名称:DataGridViewDemo,代码行数:14,代码来源:Form1.cs


注:本文中的System.Windows.Forms.DataGridViewEditingControlShowingEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。