Skip to main content

Problem:

DataGridView : How can I pick up the double-click line event in a datagridview in the .Net Framework V2?

Resolution:

You can detact the hit on a cell by trapping the "CellClickEvent". This event passes in an Event object that contains the "RowIndex". This can then to used to process the whole row using code such as:-

           set gridRow to dataGridView1::"Rows"::"Item"(e::"RowIndex")

           set selectedrow to class-string::"Concat"("Selected :  ",gridrow::"Cells"::"Item"(0)::"Value"," - ",gridrow::"Cells"::"Item"(1)::"Value", " - ",gridrow::"Cells"::"Item"(2)::"Value")

           invoke cMessageBox::"Show"(selectedrow)

Old KB# 3921