Avoiding dragging of columns in flex DataGrid control.

By default the dragging is set to true, and the property that is set is draggableColumns.

This means that the columns of the DG are draggable and can be put anywhere in the DG.

But this dragging of columns may seems unrequited, and its “true”by default and some of the flex developers may not require this default setting and they cannot figure it how to disable this dragging and which property to use.So here is the solution.

Simply set the property  draggableColumns to false [draggableColumns=”false”].This will disable the dragging of columns.So happy Flexing.

code Example:

<mx:DataGrid x=”98″ y=”212″ id=”dgcolor” draggableColumns=”false”>
<mx:columns>
<mx:DataGridColumn headerText=”Column 1″ />
<mx:DataGridColumn headerText=”Column 2″ />
<mx:DataGridColumn headerText=”Column 3″ />
</mx:columns>
</mx:DataGrid>

And not to mention this is my 50th post at the blog.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: