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

Sachin SinghRank #66 · 26.2K reputationPosted Jul 10, 2022, 1:27 PM EDT
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
}
Ramco RamcoRank #462 · 5.4K reputationPosted Jul 11, 2022, 5:00 AM EDT