Control method for the problem of non-editable row of DataGrid

Source: Internet
Author: User

The DataGrid cannot be edited line a simpler way to editable= "true" and then simply stop Itemeditbegin to stop Createitemeditor calls

------Solution--------------------Write renderer, renderer can get your point of this cell is the first few lines and columns, according to the row and column 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 and makes a judgment (which row can be edited by using properties to upload to renderer); 3. if (true), set the editable property of the Listdata.owner (or parentdocuemnt) to true, and then place the cursor over the cell that is clicked (set the Editeditemposition property, how to check it yourself); 4. Listen for the Itemeditend event in the DataGrid, the editable function in the event handler is set to false------solution--------------------(validated) think of a simpler way, editable= " True, and then simply stop Itemeditbegin to stop Createitemeditor calls, listen to the Itemeditbegin event code for the DataGrid as follows: Private Function Onitemeditbegin (  Event:datagridevent): void {if (Event.rowindex = = 0)//If is the first line, do not let edit {event.stopimmediatepropagation (); }  }
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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: and provide relevant evidence. A staff member will contact you within 5 working days.