Dear All,

I am facing an problem in datagrid ordering

Sample code

<?xml version="1.0" encoding="utf-8"?>
<!--
http://blog.flexexamples.com/2007/08/30/toggling-draggable-columns-in-a-flex-datagrid-control/-->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";

        verticalAlign="middle"
        backgroundColor="white">

    <mx:Script>
        <![CDATA[
            import mx.controls.dataGridClasses.DataGridColumn;
            import mx.controls.DataGrid;
            import mx.events.IndexChangedEvent;

            private function
dataGrid_headerShift(evt:IndexChangedEvent):void {
                var dg:DataGrid = DataGrid(evt.currentTarget);
                var column:DataGridColumn = dg.columns[evt.newIndex];
                debug.text += column.dataField + " (oldIndex:" +
evt.oldIndex + ", newIndex:" + evt.newIndex + ")" + "\n";
                if(evt.newIndex<5){
                    evt.newIndex=evt.oldIndex;
                }
            }
        ]]>
    </mx:Script>

    <mx:Array id="arr">
        <mx:Object label="User 1" data="1" />
        <mx:Object label="User 2" data="2" />
        <mx:Object label="User 3" data="3" />
        <mx:Object label="User 4" data="4" />
        <mx:Object label="User 5" data="5" />
        <mx:Object label="User 6" data="6" />
        <mx:Object label="User 7" data="7" />
        <mx:Object label="User 8" data="8" />
    </mx:Array>

    <mx:DataGrid id="dataGrid"
            dataProvider="{arr}"
            headerShift="dataGrid_headerShift(event)">
        <mx:columns>
            <mx:DataGridColumn dataField="label"  headerText="1"
draggable="false" />
            <mx:DataGridColumn dataField="data" headerText="2"
draggable="false"/>
            <mx:DataGridColumn dataField="label" headerText="3"
draggable="false"/>
            <mx:DataGridColumn dataField="data" headerText="4"
draggable="false"/>
            <mx:DataGridColumn dataField="label" headerText="5"/>
            <mx:DataGridColumn dataField="data" headerText="6"/>
            <mx:DataGridColumn dataField="label" headerText="7"/>
            <mx:DataGridColumn dataField="data" headerText="8"/>
        </mx:columns>
    </mx:DataGrid>

    <mx:TextArea id="debug"
            width="{dataGrid.width}"
            height="{dataGrid.height}" />

</mx:Application>


PROBLEM :-

I have an datagrid with 8 columns. the first four columns should not be
draggable but i can able to drag 5 th column and set it as 2 nd or 3rd
column , it should not be do. i would like to maintain first 4 columns as no
change after that columns draggable what is alteration code for me

please help me anyone


Regards,
Dhileeepen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to