Hi
private void dataGridView1_MouseDoubleClick(object sender, MouseEventArgs e)
{
var value = grdPlanning.SelectedRow.Cells[0].Text;
//var value = grdPlanning.SelectedRows[0].Cells[0].ToString();
}
Thanks
Ramco RamcoPosted Jul 11, 2022, 9:00 AM
Sachin SinghPosted Jul 10, 2022, 5:27 PM
There is no mosue double click event of Gridview.
If you want the double click feature then use javascript instead and use it inside RowdataBound event
private void gr_RowDataBound(EventArgs.....)
{
e.Row.Attributes.Add("ondblclick", "javascript:return GetCellValue('" + e.Row.Cells[0].Text.Replace("'", "''") + "'););
}
function GetCellValue(data)
{
alert(data);
// or assign the value to hiddenfield or textbox or variable
}