Avoiding the resizing of columns in flex DataGrid Control.

January 9, 2008

The columns in DataGrid control are re-sizable by  default i.e the user can put his mouse on the column and it will show the sizing icon and can move the column by press-hold the mouse.In brief sizing the column to our need for a better view.

So here by default it is set “true”  and the property that is set is resizableColumns.And to avoid this just set it to “false”.

code Example:

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

Thats it the change is visible ..


Avoiding dragging of columns in flex DataGrid control.

January 9, 2008

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.