本文整理汇总了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);
}
}
}
示例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 { }
}
}
示例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
{
}
}
示例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();
}
示例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();
}
示例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();
}
}
示例7: dgAttendee_CellMouseDown
private void dgAttendee_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
dgAttendee.CurrentCell = dgAttendee[e.ColumnIndex, e.RowIndex];
}
}
示例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();
}
}
示例9: dataGridView1_CellMouseDoubleClick
private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
{
AccountOperation addMAccount = new ModifyAccount(e.RowIndex);
addMAccount.SetDataTable(originalTable);
addMAccount.ShowDialog();
FillTheDatagrid();
}
示例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;
}
示例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";
}
}
示例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;
}
示例13: OnCellMouseUp
protected override void OnCellMouseUp(DataGridViewCellMouseEventArgs e)
{
base.OnCellMouseUp(e);
if (e.Button == MouseButtons.Right)
this.menuRemove.Show(this, e.Location);
}
示例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);
}
}
示例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;
}
}
}
}