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


C# Forms.DataGridViewCellMouseEventArgs类代码示例

本文整理汇总了C#中System.Windows.Forms.DataGridViewCellMouseEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DataGridViewCellMouseEventArgs类的具体用法?C# DataGridViewCellMouseEventArgs怎么用?C# DataGridViewCellMouseEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DataGridViewCellMouseEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了DataGridViewCellMouseEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: dataGridView2_RowHeaderMouseClick

 private void dataGridView2_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {            
     if (dataGridView2.SelectedRows.Count > 0)
     {
         DataGridViewRow row = dataGridView2.SelectedRows[0];
         _inventoryModelTemp = (InventoryModel)row.DataBoundItem;
         if (!string.IsNullOrEmpty(txtDesde.Text) && !string.IsNullOrEmpty(txtHasta.Text))
         {
             DateTime initDate;
             DateTime endDate;
             if (DateTime.TryParse(txtDesde.Text, out initDate) && DateTime.TryParse(txtHasta.Text, out endDate))
             {
                 dataGridView1.DataSource = _inventory.GetInventoryDetail(_inventoryModelTemp.IdProduct, initDate, endDate, lstTipoMovimiento.SelectedValue.ToString());
             }
             else
             {
                 dataGridView1.DataSource = _inventory.GetInventoryDetail(_inventoryModelTemp.IdProduct);
             }
         }
         else
         {
             dataGridView1.DataSource = _inventory.GetInventoryDetail(_inventoryModelTemp.IdProduct);
         }                
     }
 }
开发者ID:ARESFAAS,项目名称:SolucionFacturando,代码行数:25,代码来源:Inventario.cs

示例2: dataGridView_CellMouseDown

        public void dataGridView_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                try
                {

                    c = (sender as DataGridView)[e.ColumnIndex, e.RowIndex];
                    if (!c.Selected)
                    {
                        c.DataGridView.ClearSelection();
                        c.DataGridView.CurrentCell = c;
                        c.Selected = true;
                    }
                    string add_line;
                    if (c.Value.ToString() != "")
                    {
                        add_line = c.Value.ToString();
                    }
                    else
                    {
                        add_line = "Пустые";
                    }
                    c.DataGridView.ContextMenuStrip.Items["ContainsMenuItem"].Text = String.Format("Cодержит \"{0}\"", add_line);
                    c.DataGridView.ContextMenuStrip.Items["NotContainsMenuItem"].Text = String.Format("Не содержит \"{0}\"", add_line);
                    c.DataGridView.ContextMenuStrip.Items["EqualsMenuItem"].Text = String.Format("Равно \"{0}\"", add_line);
                    c.DataGridView.ContextMenuStrip.Items["NotEqualsMenuItem"].Text = String.Format("Не равно \"{0}\"", add_line);
                    c.DataGridView.ContextMenuStrip.Items["ClearFilterMenuItem"].Text = String.Format("Снять фильтр с \"{0}\"", c.OwningColumn.HeaderText);

                }
                catch { }
            }
        }
开发者ID:RussstyHead,项目名称:VP_ON,代码行数:33,代码来源:TableContextMenuStrip.cs

示例3: dataGridViewMaker_CellMouseClick

        private void dataGridViewMaker_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                selectIndex = e.RowIndex;
              //  selectRow = dataGridViewMaker.Rows[selectIndex].Cells[2].Value.ToString();
                selectIdBrand = int.Parse(dataGridViewMaker.Rows[selectIndex].Cells[1].Value.ToString());

                using (CsvReader csv = new CsvReader(new StreamReader(filePathMoels), true, ';'))
                {
                    int i = 0;
                    dataGridViewModel.Rows.Clear();
                    while (csv.ReadNextRecord())
                    {
                        if (int.Parse(csv[1]) == selectIdBrand)
                        {
                            dataGridViewModel.Rows.Add();
                            dataGridViewModel.Rows[i].Cells[0].Value = i + 1;
                            dataGridViewModel.Rows[i].Cells[1].Value = csv[0];
                            dataGridViewModel.Rows[i].Cells[2].Value = csv[2];
                            i++;
                        }
                    }
                }
            }
            catch
            {

            }
        }
开发者ID:VikaBoboshko,项目名称:Car,代码行数:30,代码来源:Model.cs

示例4: Data_Os_CellMouseDoubleClick

        private void Data_Os_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            int IdOs = int.Parse(Data_Os.CurrentRow.Cells[0].Value.ToString());
            Frm_EditarOS frm_Editaros = new Frm_EditarOS(v_IdTecnico, IdOs);

            frm_Editaros.ShowDialog();
        }
开发者ID:CristianoRC,项目名称:SoftwareOrdemDeServico,代码行数:7,代码来源:Frm_ListarOrcamento.cs

示例5: OnRowHeaderMouseClick

 protected void OnRowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     Guid ID = Guid.Parse(FlightGridView.Rows[e.RowIndex].Cells["ID"].Value.ToString());
     if(idSelectionCallBack!=null)
         this.idSelectionCallBack(ID);
     this.Close();
 }
开发者ID:jahandideh-iman,项目名称:Airport-Reservation-System,代码行数:7,代码来源:SelectFlightPage.cs

示例6: dataGridView1_CellMouseClick

 private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.ColumnIndex == 1 && e.RowIndex!= -1)
     {
         (new VisualizarJugador(int.Parse(dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString()))).ShowDialog();
     }
 }
开发者ID:hodesagustin,项目名称:tpDDS,代码行数:7,代码来源:BusquedaJugadores.cs

示例7: dgAttendee_CellMouseDown

 private void dgAttendee_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         dgAttendee.CurrentCell = dgAttendee[e.ColumnIndex, e.RowIndex];
     }
 }
开发者ID:desjarlais,项目名称:restfuloutlook,代码行数:7,代码来源:AttendeeForm.cs

示例8: ArgumentOutOfRangeException

 void out方法_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex < 0)
     {
         return;
     }
     var __名称 = (string)this.out值[0, e.RowIndex].Value;
     var __元数据 = _事件.形参列表[e.RowIndex].元数据;
     var __单元格 = this.out值[_值所在列索引, e.RowIndex];
     var __值 = __单元格.Value == null ? "" : __单元格.Value.ToString();
     switch (__元数据.结构)
     {
         case E数据结构.点:
             break;
         case E数据结构.行:
             var __行窗口 = new F行结构_查看(__元数据.子成员列表, "{}", __名称);
             __行窗口.ShowDialog();
             break;
         case E数据结构.列:
             var __列窗口 = new F列结构_查看(__元数据, "[]", __名称);
             __列窗口.ShowDialog();
             break;
         case E数据结构.表:
             var __表格窗口 = new F表格结构_查看(__元数据.子成员列表, "[{}]", __名称);
             __表格窗口.ShowDialog();
             break;
         default:
             throw new ArgumentOutOfRangeException();
     }
 }
开发者ID:xiaomiwk,项目名称:K_tongyongfangwen,代码行数:30,代码来源:F对象_事件.cs

示例9: dataGridView1_CellMouseDoubleClick

 private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     AccountOperation addMAccount = new ModifyAccount(e.RowIndex);
     addMAccount.SetDataTable(originalTable);
     addMAccount.ShowDialog();
     FillTheDatagrid();
 }
开发者ID:hongbao66,项目名称:ERP,代码行数:7,代码来源:副本+AccountMainFrame.cs

示例10: dgvBook_CellMouseUp

 private void dgvBook_CellMouseUp(object sender, DataGridViewCellMouseEventArgs e)
 {
     DataGridView view = (DataGridView)sender;
     if (e.Button != MouseButtons.Right || e.RowIndex < 0) return;
     view.ClearSelection();
     view.Rows[e.RowIndex].Selected = true;
 }
开发者ID:tjdbcourse,项目名称:tjdbcourse,代码行数:7,代码来源:frmBookMan.cs

示例11: dataGridView1_CellMouseDoubleClick

 private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     pictureBox5.Enabled = true;
     pictureBox4.Enabled = false;
     textBox3.Text = "";
     textBox4.Text = "";
     textBox5.Text = "";
     textBox6.Text = "";
     textBox7.Text = "";
     textBox8.Text = "";
     comboBox2.Text = "";
     id = dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
     textBox3.Text = dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
     textBox4.Text = dataGridView1.Rows[e.RowIndex].Cells[2].Value.ToString();
     textBox5.Text = dataGridView1.Rows[e.RowIndex].Cells[3].Value.ToString();
     textBox6.Text = dataGridView1.Rows[e.RowIndex].Cells[4].Value.ToString();
     textBox7.Text = dataGridView1.Rows[e.RowIndex].Cells[5].Value.ToString();
     textBox8.Text = dataGridView1.Rows[e.RowIndex].Cells[6].Value.ToString();
     string dt = dataGridView1.Rows[e.RowIndex].Cells[7].Value.ToString();
     if (dt == "True")
     {
         comboBox2.Text = "Ativo";
     }
     else
     {
         comboBox2.Text = "Inativo";
     }
 }
开发者ID:GelsonBlaze,项目名称:CounterPlay,代码行数:28,代码来源:GerirClientes.cs

示例12: dtgProducto_RowHeaderMouseClick

 private void dtgProducto_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     _product = (ProductModel)(((List<ProductModel>)dtgProducto.DataSource))[e.RowIndex];
     txtDescripción.Text = _product.Description;
     lstUnidadMedida.SelectedValue = _product.IdUnit;
     checkBox1.Checked = _product.FreeProduct;
 }
开发者ID:ARESFAAS,项目名称:SolucionFacturando,代码行数:7,代码来源:Producto.cs

示例13: OnCellMouseUp

        protected override void OnCellMouseUp(DataGridViewCellMouseEventArgs e)
        {
            base.OnCellMouseUp(e);

            if (e.Button == MouseButtons.Right)
                this.menuRemove.Show(this, e.Location);
        }
开发者ID:RedHaze,项目名称:sourcesplit,代码行数:7,代码来源:EditableListBox.cs

示例14: dataGridView1_RowHeaderMouseClick

        private void dataGridView1_RowHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            try
            {
                var dr = dataGridView1.SelectedRows[0];
                Hide();
                var frm = new frmCustomers();
                frm.Show();
                frm.txtCustomerID.Text = dr.Cells[0].Value.ToString();
                frm.txtCustomerName.Text = dr.Cells[1].Value.ToString();
                frm.txtAddress.Text = dr.Cells[2].Value.ToString();
                frm.txtCity.Text = dr.Cells[4].Value.ToString();
                frm.txtLandmark.Text = dr.Cells[3].Value.ToString();
                frm.cmbState.Text = dr.Cells[5].Value.ToString();
                frm.txtZipCode.Text = dr.Cells[6].Value.ToString();
                frm.txtPhone.Text = dr.Cells[7].Value.ToString();
                frm.txtEmail.Text = dr.Cells[8].Value.ToString();
                frm.txtMobileNo.Text = dr.Cells[9].Value.ToString();
                frm.txtFaxNo.Text = dr.Cells[10].Value.ToString();
                frm.txtNotes.Text = dr.Cells[11].Value.ToString();
                frm.btnUpdate.Enabled = true;
                frm.btnDelete.Enabled = true;
                frm.btnSave.Enabled = false;
                frm.txtCustomerName.Focus();
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "ล้มเหลว", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
开发者ID:epiczeth,项目名称:SAIS,代码行数:31,代码来源:frmCustomersRecord2.cs

示例15: GridView_CellMouseDown

 void GridView_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex == -1) return;
     if (e.Button == System.Windows.Forms.MouseButtons.Right)
     {
         DataGridView dg = sender as DataGridView;
         foreach (DataGridViewCell cell in dg.Rows[e.RowIndex].Cells)
         {
             if (cell.Selected) {
                 return;
             }
         }
         foreach (DataGridViewRow r in dg.Rows)
         {
             if ((System.Windows.Forms.Control.ModifierKeys & Keys.Shift) != Keys.Shift)
             {
                 r.Selected = false;
             }
             if (r.Index == e.RowIndex)
             {
                 r.Selected = true;
             }
         }
     }
 }
开发者ID:ConradoClark,项目名称:ProjetoAdv,代码行数:25,代码来源:CadastroGrupoDiferencial.cs


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