DataGridView Full Row select

Hi,

A real quick question...

I'm using a DataGridView to show a list of record from a business collection. I want full row select (like a listview) and I want a double click to open the selected item. Am I best responding to the CellDoubleClick event the checking to make sure the user didn't doubleclick the header, or is there a better way?

[348 byte] By [Gravy] at [2008-2-15]
# 1
If you are looking to override the grid's editing, then you can handle the CellBeginEdit event, in which you cancel the edit, and display your own form. This approach has the advantage of displaying your edit form when the user starts typing into a cell.

Or, you can set your grid to ReadOnly, and capture the DoubleClick event, as you mention.

For full row select, set the SelectionMode = FullRowSelect.

durstin at 2007-9-8 > top of Msdn Tech,Windows Forms,Windows Forms Data Controls and Databinding...