Dev GridView Rowcellclick Event and MouseDown event

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.