當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。