Control method of _flex of the DataGrid

Source: Internet
Author: User
------Solution--------------------
Write Renderer Bai, renderer can get your point of this cell is the first few lines and columns, according to the row and column to change the DataGrid editable attribute, give you a thought:
1.renderer Monitor Click event;
2. The event handler function takes out the row and column index from the Listdatadata, makes the judgment (which row can edit this variable can be passed to renderer by the creation of the renderer);
3.if (True), set the editable property of the Listdata.owner (or parentdocuemnt) to true, and then place the cursor over the cell clicked (Set the Editeditemposition property, how to check it yourself);
4. Monitor the Itemeditend event in the DataGrid, set the editable function to false in the event handler function

------Solution--------------------(validated)
Think of a simpler way to editable= "true" and then simply stop Itemeditbegin to stop Createitemeditor calls,
Listen to the Itemeditbegin event in the DataGrid
Copy Code code as follows:

Private Function Onitemeditbegin (event:datagridevent): void
{
if (event.rowindex = 0)//If it is the first line, do not let the edit
{
Event.stopimmediatepropagation ();
}
}

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.