• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.DataGridViewCellMouseEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: SortColumn

        private void SortColumn(object sender, DataGridViewCellMouseEventArgs e)
        {
            var columnName = Control.GridView.Columns[e.ColumnIndex].Name;
            if (columnName == "Icon") { columnName = "Severity"; }

            Control.InspectionResults = new BindingList<CodeInspectionResultGridViewItem>(_gridViewSort.Sort(Control.InspectionResults.AsEnumerable(), columnName).ToList());
        }
开发者ID:ThunderFrame,项目名称:Rubberduck,代码行数:7,代码来源:CodeInspectionsDockablePresenter.cs


示例17: dtgvTelas_CellMouseDoubleClick

        private void dtgvTelas_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                if (dtAtual.Rows.Count > 0) //salva alterações
                {
                    salvaAlteracoes();
                }

                int tela = Convert.ToInt32(dtTelas.Rows[e.RowIndex]["tela_id"]);
                for (int i = 0; i < dtUserCampo.Rows.Count; i++)
                {
                    if (Convert.ToInt32(dtUserCampo.Rows[i]["tela_id"]) == tela)
                    {
                        int campoId = Convert.ToInt32(dtUserCampo.Rows[i]["camp_id"]);
                        bool campAcesso = Convert.ToBoolean(dtUserCampo.Rows[i]["usuariocamp_acesso"]);
                        String campNome = "" + dtUserCampo.Rows[i]["camp_nome"];
                        DataRow linha = dtAtual.NewRow();
                        linha["camp_id"] = campoId;
                        linha["tela_id"] = tela;
                        linha["usuariocamp_acesso"] = campAcesso;
                        linha["camp_nome"] = campNome;
                        dtAtual.Rows.Add(linha);
                    }
                }
            }
        }
开发者ID:4nub1s,项目名称:infoGym,代码行数:27,代码来源:frmUserPerm.cs


示例18: dgvMilitaries_ColumnHeaderMouseClick

 private void dgvMilitaries_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     PropertyComparer comparer = new PropertyComparer(this.dgvMilitaries.Columns[e.ColumnIndex].DataPropertyName, this.dgvMilitaries.Columns[e.ColumnIndex].DefaultCellStyle.Alignment == DataGridViewContentAlignment.MiddleRight, this.smalltobig);
     this.Militaries.Sort(comparer);
     this.RebindDataSource();
     this.smalltobig = !this.smalltobig;
 }
开发者ID:skicean,项目名称:ZhongHuaSanGuoZhi,代码行数:7,代码来源:frmSelectMilitaryList.cs


示例19: dataGridViewResults_CellMouseClick

        private void dataGridViewResults_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            GeneSequence seqA = m_sequences[e.ColumnIndex];
            GeneSequence seqB = m_sequences[e.RowIndex];

            String[] results = processor.extractSolution(seqA, seqB);
            String outputMessage = String.Format("Output Console: {0}= MATCH, {1}= SUB, {2}= INDEL",
                processor.MATCH_CHAR, processor.SUB_CHAR, processor.INDEL_CHAR);

            String outputText = String.Format("{0}\r\nGene Alignment for Cell (Row:{1}, Col:{2})\r\nA: {3}\r\n   {4}\r\nB: {5}",
                outputMessage,
                e.RowIndex + 1,
                e.ColumnIndex + 1,
                processor.formatSequence(results[0], MaxToDisplay),
                processor.formatSequence(results[2], MaxToDisplay),
                processor.formatSequence(results[1], MaxToDisplay));

            String sideText = String.Format("\r\n\r\nA: {0}\r\n\r\nB: {1}\r\n\r\nA: {2}\r\n\r\nB: {3}",
                seqA.Name,
                seqB.Name,
                processor.formatSequence(seqA.Sequence, 15),
                processor.formatSequence(seqB.Sequence, 15));

            sideBar.Text = sideText;
            outputConsole.Text = outputText;
        }
开发者ID:jrasm91,项目名称:cs312,代码行数:26,代码来源:MainForm.cs


示例20: dataGridView1_CellMouseClick

 private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         dataGridView1.ReadOnly = true;
     }
 }
开发者ID:slovyan,项目名称:Monsters,代码行数:7,代码来源:Form1.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.DataGridViewCellPaintingEventArgs类代码示例发布时间:2022-05-26
下一篇:
C# Forms.DataGridViewCellFormattingEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap