i have method
private void getValues(object sender, EventArgs e)
{
int id = int.Parse(dgvTable.Rows[dgvTable.CurrentRow.Index].Cells[0].Value.ToString());
var values = from c in v.db.TotalDoc
where c.TotalID == id
select c.TotalAmount;
dgvValues.DataSource = values;
}
and datagridview "dgvTable" error at this line
dgvTable.CellClick += new EventHadler(getValues);
error text is: No overload for 'getValues' matches delegate 'System.EventHandler'
please help!
The DataGridView.CellClick
method signature is a DataGridViewCellEventHandler
and not of type EventHandler
. Change your method signature to this:
private void getValues(object sender, DataGridViewCellEventArgs e)
and also change your declaration to this:
dgvTable.CellClick += new DataGridViewCellEventHandler(getValues);
private void getValues(object sender, DataGridViewCellEventArgs e)