datagrid double click function

G

Guest

hi Guys,

i want to implement the double click functionality in datagrid. I am using
c#. can some one recomend a good article whihc shows you how to do it.

Thanks

Manny
 
G

Guest

Here is a sample that can help you


You can use the DataGrid's double-click event and its HitTest method to
catch a double click on a header.

private void dataGrid1_DoubleClick(object sender, System.EventArgs e)

{

System.Drawing.Point pt = dataGrid1.PointToClient(Cursor.Position);



DataGrid.HitTestInfo hti = dataGrid1.HitTest(pt);



if(hti.Type == DataGrid.HitTestType.ColumnHeader)

{

MessageBox.Show("double clicked clicked column header " +
hti.Column.ToString());

}

}



Fernando Hunth ([email protected])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top