The GridView is in an editable state, and the left click Defaults to "Go to edit".
Setting the optionbehavior-editable of the GridView to false left-click Triggers Rowcellclick.
Sometimes, however, you want the GridView to compile, and you want to trigger a "cell Click event", such as a requirement to click on a column cell to eject the form, select the data and return to the GridView, and allow manual modification or input on the GridView. What should we do with it?
With the MouseDown event of the GridView, the specific code is as follows:
private void Gviewactpara_mousedown (object sender, MouseEventArgs e) { Gridhitinfo hint = Gviewactpara.calchitinfo (e.x, e.y); if (Gviewactpara.rowcount = = 0 | |/* Record number is greater than 0*/ !hint. Inrowcell/* Valid cell */| | E.button! = mousebuttons.left/* left mouse button */| | E.clicks! = 1/ * click */ ) { return; } if (hint. Column.fieldname = = "need to pop up the column name of the form and the column FieldName") { //strong to the current row (to avoid the mouse click of the row and focus row Focusedrowhandle inconsistent, mouse click, Focus line Focusedrowhandle not yet converted) Gviewactpara.focusedrowhandle = hint. rowhandle;//Open the form's code and handle it slightly//if you get the value of the open form, you need to update to the GridView using//Gviewactpara.setrowcellvalue (hint. Rowhandle, "FieldName to accept the Value column", the value obtained from the form); Use Setrowcellvalue to trigger gviewactpara_cellvaluechanged event } }
Dev GridView Rowcellclick Event and MouseDown event