How to make some of my datagridcolumn not editable or readonly if my flexible datagrid is editable

How to make some of my datagridcolumn not editable or readonly if my flexible datagrid is editable?

+3
source share
2 answers

DataGridColumnhas a property editable. Just set it to false.

See the documentation for the DataGridColumn .

Here is a quick example of a DataGrid with one editable column:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

    <mx:DataGrid id="testGrid" editable="true">
        <mx:columns>
            <mx:DataGridColumn headerText="Column1" dataField="column1" editable="false" />
            <mx:DataGridColumn headerText="Column2" dataField="column2" />
        </mx:columns>
        <mx:dataProvider>
            <mx:ArrayCollection>
                <mx:Object>
                    <mx:column1>Some Value</mx:column1>
                    <mx:column2>Some Other Value</mx:column2>
                </mx:Object>
            </mx:ArrayCollection>
        </mx:dataProvider>
    </mx:DataGrid>
</mx:Application>

The first column is not editable, the second -.

+7
source

Set property IsReadOnly=True

+2
source

Source: https://habr.com/ru/post/1769307/


All Articles