Datagrid rearranging columns?

I'm having a problem. This code i have written will import
the XML but it rearranges the fields when i do this:
"for (var subKey:String in data[0])"
All of the fields come through but the subKey order is not in
the order of the actual XML. Is there any way to get the
"$ColumnNames[$w]" var from php over to flex in the same order?
I don't know if i just reinvented the wheel, but it was
definitely a good learning experience.
MXML is first then PHP is second. Some of the code is copied
off other examples. I didn't see any copyrights but let me know if
there are any problems. O and the error thing doesn't work on the
PHP page.

I am look for a solution to a similar problem.
I've got this nice little .fla that displays a DataGrid component (Flash CS3 Professional) using a DataProvider created from XML loaded from URLRequest/URLLoader (.asp source, but could be PHP, etc.).
It works great except for one little annoying item.  The order of the columns seems to be totally arbitrary.
I was expecting the order of the column to be the same as they occur in the XML DATA element.
Here is a sample DATA element (there are serveral such DATA elements in the XML:
<DATA>
  <AreaID>TNV</AreaID>
  <AreaName>TN, VA</AreaName>
  <MaxDvrHT>4</MaxDvrHT>
  <BoardName>TN, VA</BoardName>
  <RegionName>SOUTHEAST</RegionName>
  <salesGroup>David</salesGroup>
</DATA>
Here is the function that builds DataGrid:
function returnAJAXcallback(evtObj:Event):void{
// executed by URLLoader event listener "complete"
// load the XML returned from .asp into XML object
var myXML:XML = XML(evtObj.target.data);   
// create a data provider from the XML
var myDP = new DataProvider(myXML);  
// create a DataGrid
var myDataGrid:DataGrid = new DataGrid;  
// set the data provider
myDataGrid.dataProvider=myDP;   
myDataGrid.width = 900;
myDataGrid.height = 500;
// show DataGrid on stage
addChild(myDataGrid);     
for each (var child:XML in myXML.DATA) {
  trace(child) ;  // list each DATA segment
Here is the order that the columns appear in the DataGrid (left to right):
AreaName
RegionName
salesGroup
AreaID
MaxDvrHT
BoardName
So, how in the world does Flash come up with this order?
Why not default to the order in which the columns appear in the XML?
Now, if some nice person knows the answer (I'm pretty new to Flash), what do I need to do (with as little code as possible) to get the columns ordered in a similar fashion to the order in which the XML data elements appear?
Thanks to all.

Similar Messages

  • Flex datagrid data column / webservice

    I use a web service to populate a datagrid and its columns
    (on of which is date). The web services sources the data from a sql
    server database and thru ASP.net to the Flex application. I've been
    seeing strange things. During testing, database records such as
    "8/27/2008 8:58:00 PM " correctly shows up as 8/27/2008 in the Flex
    application, but records after 9PM such as "8/27/2008 9:01:21 PM"
    shows up as 8/28/2008 (the next days) .. seems like after 9 throws
    off the data rendering.. please suggest.

    Adobe Newsbot hopes that the following resources helps you.
    NewsBot is experimental and any feedback (reply to this post) on
    its utility will be appreciated:
    Flex 3 - Handling service results:
    Flex interprets the XML data that a web service or HTTP
    service returns to ..... a DataGrid control with DataTable data
    returned from a .NET web service.
    Link:
    http://livedocs.adobe.com/flex/3/html/data_access_6.html
    Flex cookbook beta - Building Flex Applications with SOAP Web
    Services:
    Mar 3, 2008 ... If you are using web services technologies
    then it is usually ... The DataGrid tag instanciates an instance of
    the DataGrid Flex control.
    Link:
    http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postI d=7863
    Flex 3 - Using WebService components:
    The Flex web service API generally supports Simple Object
    Access Protocol (SOAP) ... property of a DataGrid control and
    displayed in the DataGrid control.
    Link:
    http://livedocs.adobe.com/flex/3/html/data_access_3.html
    Adobe - Flex General Discussion:
    Flex datagrid data column / webservice - justneed2know -
    08/27/2008 ... I use a web service to populate a datagrid and its
    columns (on of which is date).
    Link:
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=60&catid=585&threadid =1388794&enterthread=y
    All Classes (Flex 3):
    mx.rpc.soap, AbstractWebService is an abstract base class for
    implementations that provide RPC access to SOAP-based web services.
    Link:
    http://livedocs.adobe.com/flex/3/langref/class-summary.html
    Adobe - Developer Center : Using Flex Builder to Create Web:
    Using Flex Builder to Create Web ServiceBased Flex
    Applications ... The web service result data needs to flow to the
    DataGrid. Select the 'Data will flow
    Link:
    http://www.adobe.com/devnet/flex/articles/flexbuilder_ws_04.html
    Disclaimer: This response is generated automatically by the
    Adobe NewsBot based on Adobe
    Community
    Engine.

  • Rearrange column in Datagrid in Flex

    Hi, i am retrieving data from database using arraycollection to fill in the datagrid with dynamic column header, and the columns are arranger alphabatically depend on the column header title, for my case i want to rearrange the columns depend on specific order, i created another function to rearrange the columns, and its working fine for the first page load but when i change the dropdown entries i get all the columns rearranged but without data only the first column contain data which is [EngName]
    the following is my code
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()" layout="vertical"  width="70%" backgroundAlpha="1" backgroundColor="white" xmlns:local="*">
    <mx:WebService id="wsExec" wsdl="http://wfsvc-test/ExecSummaryReport.asmx?WSDL" useProxy="false" showBusyCursor="true">
    <mx:operation name="GetExecSummary2" result="handleExecSummaryResult(event)" fault="handleFault(event)"/>
    </mx:WebService>
    <mx:WebService id="wsAdmin" wsdl="http://wfsvc-test/Admin.asmx?wsdl" useProxy="false" showBusyCursor="true">
    <mx:operation name="SelectDirectorates" result="handleDir(event)" fault="handleFault(event)"/>
    <mx:operation name="SelectSections" result="handleSec(event)" fault="handleFault(event)"/>
    </mx:WebService>
    <mx:Script>
    <![CDATA[
    import mx.controls.dataGridClasses.DataGridColumn;
    import mx.messaging.AbstractConsumer;
    import mx.collections.ArrayCollection;
    import mx.controls.Alert;
    import mx.rpc.events.FaultEvent;
    import mx.rpc.events.ResultEvent;
    [Bindable]
    private var gridData:ArrayCollection;
    [Bindable]
    private var dirData:ArrayCollection;
    [Bindable]
    private var secData:ArrayCollection;
    private function init():void
      wsAdmin.SelectDirectorates();
      var today:Date = new Date();
      today.setDate(1);
      dtFrom.selectedDate =today;
      dtTo.selectedDate = new Date();
    private function handleExecSummaryResult(event:ResultEvent):void
      for each(var objTbl:Object in event.result.Tables)
       gridData = objTbl.Rows as ArrayCollection;
      dg.dataProvider = gridData;
      var columns:Array = dg.columns.sort(orderColumns);
      dg.columns = columns;
      dg.visible = true;
    private function orderColumns(a:DataGridColumn, b:DataGridColumn):int{
       if (a.headerText == "EngName" || b.headerText == "EngName"){
              return -1;
       }else if (a.headerText < b.headerText){
              return -1;
       }else if (a.headerText > b.headerText){
               return 1;
      } else {
        return 0;
    private function handleDir(event:ResultEvent):void
      var dirArr:Array = new Array();
      var defaultItem:Object = new Object();
      defaultItem['data'] = '00';
      defaultItem['label'] = '-- Select Directorate --';
      dirArr.push(defaultItem);
      for each(var objTbl:Object in event.result.Tables)
       for each(var objRow:Object in objTbl.Rows)
        var obj:Object = new Object();
        obj['label'] = objRow['EngDir'];
        obj['data'] = objRow['DirCode'];
        dirArr.push(obj);
      dirData = new ArrayCollection(dirArr);
    private function handleSec(event:ResultEvent):void
      var secArr:Array = new Array();
      var defaultItem:Object = new Object();
      defaultItem['data'] = '00';
      defaultItem['label'] = '-- Select Section --';
      secArr.push(defaultItem);
      for each(var objTbl:Object in event.result.Tables)
       for each(var objRow:Object in objTbl.Rows)
       var obj:Object = new Object();
       obj['label'] = objRow['EngSec'];
       obj['data'] = objRow['SecCode'];
       secArr.push(obj);
      secData = new ArrayCollection(secArr);
    private function handleFault(event:FaultEvent):void
      Alert.show(event+'');
    ]]>
    </mx:Script>
    <mx:Label width="100%" textAlign="center" text="Executive Summary Report" fontSize="24"/>
    <mx:HBox width="100%">
    <mx:HBox width="100%" horizontalAlign="right" verticalAlign="middle" >
    </mx:HBox>
    </mx:HBox>
    <mx:HBox width="100%">
      <mx:Label text="Search: From"/>
      <mx:DateField id="dtFrom" name="n1" formatString="DD/MM/YYYY"/>
      <mx:Label text=" To "/>
      <mx:DateField id="dtTo" name="n1" formatString="DD/MM/YYYY"/>
      <mx:Label text="   Directorate:"/>
      <mx:ComboBox id="ddlDir" dataProvider="{dirData}" width="170">
       <mx:change>
        <![CDATA[
         wsAdmin.SelectSections(ddlDir.selectedItem['data'].toString());
        ]]>
       </mx:change>
      </mx:ComboBox>
      <mx:Label text=" Section:"/>
      <mx:ComboBox id="ddlSec" dataProvider="{secData}" width="170"/>
      <mx:Label text="Status: "/>
       <mx:CheckBox id="chkCompleted" label="Completed" selected="true">
        <mx:click>
         <![CDATA[
          chkCompleted.selected = true;
          chkInProgress.selected = false;
         ]]>
        </mx:click>
       </mx:CheckBox>
       <mx:CheckBox id="chkInProgress" label="In Progress">
        <mx:click>
         <![CDATA[
          chkCompleted.selected = false;
          chkInProgress.selected = true;
         ]]>
        </mx:click>
       </mx:CheckBox>
      <mx:Button label="Show Report">
       <mx:click>
        <![CDATA[
         if(ddlDir.selectedIndex<1 || ddlSec.selectedIndex<1)
          Alert.show('Please select a Directorate & Section');
         }else
          wsExec.GetExecSummary2(ddlDir.selectedItem['data'],ddlSec.selectedItem['data'],chkInProgr ess.selected,dtFrom.selectedDate,dtTo.selectedDate);
        ]]>
       </mx:click>
      </mx:Button>
    </mx:HBox>
    <mx:DataGrid id="dg" width="100%" rowCount="12"  visible="false"/>
    </mx:Application>

    I'm suspicous about how it can return -1 for both A.headerText and
    b.headerText == "EngName"

  • Right way to change datagrid row, column, cells background colors in code-behind?

    Hi all,
    I have a winform program that I'm upgrading to wpf (I'm new to wpf). The wpf code for the function (SetdataGridBackgroundColors()) is below with the winform code commented out so I can fix it.  I have a datagrid with a Cornsilk background color alteranating
    with LightGreen depending on the content of datetime  cell. If the day portion of the datetime is different then the color changes from one to the other. I used a colorIndex variable because at the end of the month it could go from 31 to 1 and that would
    not work if I use the day directly.
    I tried this line to change the background color:
    optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.Cornsilk);
    this works but it changes every row. I found this other stuff:
    DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow;
    //DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromItem(optionsDataDatagrid.Items[i]) as DataGridRow;
    currentRowColor.Background = new SolidColorBrush(Colors.Cornsilk);
    Either ContainerFromIndex or ContainerFromItem throw an exception because currentRowColor is null. I looked at optionsDataDatagrid.Items[i] and is not null. Then I read that using ItemContainerGenerator is not a good idea.
    BTW I'm calling SetdataGridBackgroundColors() after datagrid is been filled with data.
    So... what is the proper way to set each row, column or cell background color in wpf?
    Thanks
    private void SetdataGridBackgroundColors()
    optionRowData rowData = new optionRowData();
    if (optionsDataDatagrid.Items.Count == 0)
    return;
    int colorIndex = 1;
    DateTime savedDate, currentRowDate;
    rowData = optionsDataDatagrid.Items[0] as optionRowData;
    savedDate = rowData.col_datetime.Date; //only compare the date not the time
    for (int i = 0; i < optionsDataDatagrid.Items.Count; i++)
    //currentRowDate = Convert.ToDateTime(optionsDataDatagrid.Rows[i].Cells[3].Value); //winform code
    //currentRowDate = currentRowDate.Date; //winform code
    rowData = optionsDataDatagrid.Items[i] as optionRowData;
    currentRowDate = rowData.col_datetime.Date;
    if (currentRowDate != savedDate)
    colorIndex++;
    savedDate = currentRowDate;
    if (colorIndex % 2 == 0)
    //optionsDataDatagrid.Rows[i].DefaultCellStyle.BackColor = Color.Cornsilk;
    //------------------- testing new code --------------begin
    optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.Cornsilk); //this changes all rows
    //DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow;
    //DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromItem(optionsDataDatagrid.Items[i]) as DataGridRow;
    //currentRowColor.Background = new SolidColorBrush(Colors.Cornsilk);
    //------------------- testing new code --------------end
    //optionsDataDatagrid.Columns[4].DefaultCellStyle.BackColor = Color.DarkSalmon;
    //optionsDataDatagrid.Columns[5].DefaultCellStyle.BackColor = Color.Aquamarine;
    //optionsDataDatagrid.Rows[i].Cells[4].Style.ApplyStyle(optionsDataDataGridView.Columns[4].DefaultCellStyle);
    //optionsDataDatagrid.Rows[i].Cells[5].Style.ApplyStyle(optionsDataDataGridView.Columns[5].DefaultCellStyle);
    else
    //optionsDataDatagrid.Rows[i].DefaultCellStyle.BackColor = Color.LightGreen;
    //------------------- testing new code --------------begin
    optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.LightGreen); //this has no effect
    //------------------- testing new code --------------end
    //optionsDataDatagrid.Columns[4].DefaultCellStyle.BackColor = Color.Coral;
    //optionsDataDatagrid.Columns[5].DefaultCellStyle.BackColor = Color.LimeGreen;
    //optionsDataDatagrid.Rows[i].Cells[4].Style.ApplyStyle(optionsDataDataGridView.Columns[4].DefaultCellStyle);
    //optionsDataDatagrid.Rows[i].Cells[5].Style.ApplyStyle(optionsDataDataGridView.Columns[5].DefaultCellStyle);

    I (also) strongly recommend mvvm.
    Setting values is a particularly bad idea in this case.
    I don't mean to be rude but your explanation of the requirement is kind of vague.
    I would bind solidcolourbrushes.
    Set the properties based on whatever your logic is within the viewmodel.
    You can switch out what each of the brushes holds when the user clicks wherever.
    So you use a highlightbrush when something or other is true.
    That highlightbrush is set to a blue brush when the user clicks left and a red brush when they click right.
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • DataGrid itemRenderer column problem

    I have searched high and low and have not found a solution so I'm hoping someone here can help me out.
    When I start up my application, my datagrid (one of the columns uses a itemrenderer) that column, displays everything but it spills / shows funky, then when I scroll some of them get fixed. I don't know exactly what causes this or how to fix it. The column I'm talking about is the "Like" column.
    If code is needed I will provide a pastebin link when requested, and I have attatched a screenshot of what the problem is.
    Any help / suggestions would be appreciated

    Upgrade to 3.4.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • How to display HyperLink on the DataGrid Component  column  data.

    Hi ,
    I am able to display customer data on to the DataGrid with the help of a ArrayCollection,
    Similar as shown :
    <mx:columns>
    <mx:DataGridColumn dataField="customerid"  headerText="Employee ID"
                       itemRenderer=""/> 
          </mx:columns>
    Please tell me what should be the value inside the itemRenderer to make the customerid display as an HyperLink ??
    I am struck up mx.controls.----?? value on to the itemRenderer 
    Please suggest .
    Thanks in advance .

    And Following is answer for http://forums.adobe.com/thread/630928?tstart=0
    <mx:DataGridColumn headerText="Employee ID"
    editorDataField="text" dataField="customerid"
    itemRenderer="mx.controls.TextInput" editable="true"/>
    Just replace TextInput--->YPaticular  controll(LinkButton)
    please help to answer this
    http://forums.adobe.com/thread/630962
    Happy codding....

  • Table (7.1 EHP 1) - Rearrange columns

    Dear all,
    In Web Dynpro java 7.0, it was possible to right click a table (while holding down the control key) and then to rearrange colunm and make some columns visible or not...
    Is this still possible in a way in the 7.1? 
    Is it possible to change the order of the columns by drag and drop?
    Kind regards,
    J.

    Thx Armin.
    This implicit personalization, is this only possibly when the web dynpro application is running in an iview?
    Are there personalization options for stand-alone web dynpro applications too?
    Kind regards,
    J.

  • DataGrid with dynamic columns & renderers

    I'm developing using Flash Builder 4 & Flex SDK 4.1.
    I need to manage very dynamic DataGrid components and keep their definitions, which are all part of a complex item renderer of an Offers list.
    The objects structure is simplified as follows -
    Data: Model --> Offers ArrayCollection --> Offer VO --> DataGrid data ArrayCollection & DataGrid columns Array
    View: List --> Offer Item Renderer --> DataGrid
    1. Since the DataGrid's columns property accepts only an Array (not ArrayCollection), it seems like Data Binding for defining the columns is very problematic.
    I tried to bind it to the source property of an ArrayCollection that would keep my columns definitions, but it didn't really work (mainly header display bugs).
    What is the recommended way to keep the dynamic columns definition of a DataGrid?
    2. Each column can have a set of dynamic properties, so I created a "mutant" - Column VO that extends DataGridColumn and got a dynamic properties ArrayCollection on it.
    The columns got a custom header renderer that includes an icon when there are properties.
    The header renderers got 4 main states (NotSelectedWithProperties, SelectedWithProperties, NotSelectedWithoutProperties & SelectedWithoutProperties).
    However, the header renderer area seems a bit buggy when maintaning dynamic columns.
    Any thoughts on the subject?
    3. Anyway, I ended up recreating the DataGrid's columns Array very often (copying the columns definition on the offer's item renderer's dataChange event handler).
    Note that the dynamic properties can be edited when the column is selected and I copy their values from the view back to the model when entering the state NotSelectedWithProperties.
    This feels way too complicated and I really try to keep it simple, inspite of the required complexity.
    Does anyone have better ideas?
    4. In some cases the column's item renderer should also be modified into another DataGrid (grid-in-grid).
    I used the MXDataGridItemRenderer with a DataGrid and included an ArrayCollection for the "newValue" returned by the editor.
    (I use RendererIsEditor=true and on updateComplete populate that variable with the DataGrid's dataProvider contents)
    When needed, I loop though the data objects of the parent DataGrid and populate the related field with an ArrayCollection of key-value objects that are displayed on the internal DataGrid.
    After adding this feature I encounter very strange bugs -
    a. After editing the grid-in-grid values and changing the column's state (selecting & deselecting), I get the following exception:
    ArgumentError. Error #2025: The supplied DisplayObject must be a child of the caller.
    at flash.display::DisplayObjectContainer/setChildIndex()
    at mx.core::UIComponent/setChildIndex().......6993....
    All I could find about this is that it might be related to some context error or something, but I'm really stuck on this one.
    b. Sometimes another column might copy value from one row to another, running over the previous value.
    I'm not sure exactly what sequence of actions causes this behavior, but it's related to that itemRenderer for sure.
    c. Switching places with a column that uses the grid item renderer (headerShift) causes a stak overflow of StyleManager that tried to get style from the DataGridItemRenderer. This one I just found out, but couldn't reproduce a second time... strange!
    I'm pretty sure this caused another problem that I don't remember at the moment.
    The bottom line is that there got to be a better way to implement this feature within this already-complicated environment.
    Maybe I'm doing something very wrong here...
    Please advice and thanks for reading all this.

    Update on item 4a -
    This was a major issue (the main reason for opening this thread really) and I managed to resolve it!
    As part of my application, I override the default DataGrid behavior for column selection (headerRelease event).
    Instead of sorting, I change the column's header looks and define it as Selected (for showing its dynamic properties and enable its deletion).
    At first I did this by setting styles, but the look didn't refresh unless I created a new instance of the header renderer.
    Later I changed thi behavior to work with states, but I left the new header renderer instance creation commands and those lines created all the mess!
    Conclusion -
    If you define a custom header renderer for your datagrid column and then a custom item renderer, don't create a new instance of your header renderer!
    It would still be nice to get some response for the other issues I raised.
    Thanks and have a nice week.

  • DataGrid binding with comumns of column ItemSource

    <DataGrid Grid.Column="1" Name="grid2" DataContext="{Binding SelectedPage}"
    ItemsSource="{Binding Params}"
    AutoGenerateColumns="False" Grid.RowSpan="2">
    <DataGrid.Columns>
    <DataGridComboBoxColumn ItemsSource="{Binding Source={StaticResource xKeySource}}"
    DisplayMemberPath="Name"
    SelectedValuePath="Name"
    SelectedValueBinding="{Binding Name}"/>
    <DataGridTextColumn Header="ParamName" Binding="{Binding Name}"/>
    <DataGridTextColumn Header="Address" Binding="{Binding Address}"/>
    <DataGridTextColumn Header="Format" Binding="{Binding Format}"/>
    <DataGridTextColumn Header="Description" Binding="{Binding Description}"/>
    </DataGrid.Columns>
    </DataGrid>
    Is it possible when I select from my ComboBoxColumn, compile automatically other columns in my DataGrid ?
    The name of fileds in ItemSource are the same of name of another binding columns (are two different list but the property name is equal).
    thanks

    I don't follow what you mean
    compile automatically other columns in my DataGrid
    If you mean change the content of other fields in the same row then yes.
    If there is a viewmodel per row you could act in the setter of the property of that which the combo is bound to.  Set those properties in the viewmodel and if it implements inotifypropertychanged then they would change in the view.
    In your markup
    <DataGridComboBoxColumn ItemsSource="{Binding Source={StaticResource xKeySource}}"
    DisplayMemberPath="Name"
    SelectedValuePath="Name"
    SelectedValueBinding="{Binding Name}"/>
    <DataGridTextColumn Header="ParamName" Binding="{Binding Name}"/>
    These are both bound to the same property though.
    You combo is in the datacontext the row is in.
    That Name property is the same as the Name property the other column would be in.
    Select combo > Name
    Enter in ParamName > Name
    Both the same property.
    Making it a property of something else would be very strange - which row is pointing at what.
    Hope that helps.
    Technet articles: Uneventful MVVM;
    All my Technet Articles

  • Fetching column data for clicked DataGrid cell

    I am using a DataGrid and the number of columns are based on the data thus dynamic; columns are added at runtime.  I am trying to use the same ItemRenderer for all columns.  The one piece I can not seem to get to work is knowing which datafield to use to populate each column.  I have tried getting the column.dataField from the current datacolumn to no avail; sample code listed below.  This is my first Flex project so my approach to the problem may not be the best; please alert me if this is the case.  I would appreciate any help you could lend.
                    var dgListData:DataGridListData = listData as DataGridListData;
                    var dataGrid:DataGrid = dgListData.owner as DataGrid;
                    var column:DataGridColumn = dataGrid.columns[dgListData.columnIndex];
                    var dataField = column.dataField;
                    var lbl:Label = new Label();
                    lbl.text = value[dataField];    // must add based on previously named source field; dataField
    ce

    Update:
         A few more details...
    I am trying to do this inside of override public function set data(value:Object):void {}

  • Hide Specific Datagrid Column Header

    Hi,
    I'm asking for if ther is a method to hide a specific
    datagrid header colum;
    The showHeaders property of datagrid give me the possibility
    to set the visibility of all datagrid header column.
    There is a way to hide, for example, the header of first
    datagrid column?
    PLEASE HELP ME!!
    Thank you

    "markuspedro" <[email protected]> wrote in
    message
    news:glvr3g$gls$[email protected]..
    > thank's, but this solution not run.. i would hide the
    header of specif
    > column..
    >
    > It' s impossible that flex give us the possibility to
    hide only the header
    > of all columns...
    If you hide the header, then the space it occupies will still
    be there, so
    the rows will line up. Try using a headerRenderer wit one
    state that shows
    the header text and one state that shows nothing.

  • Putting multiple items into a single column in a datagrid

    Okay,
    So I can put information into a datagrid, I can select a row
    and make sure that it populates that row. I can even make it hit
    that specific row and column.
    How do I got about having several different buttons all
    writing in the same column? And perhaps even ordering it? i.e. The
    column would look like this: buttonOneInput, buttonTwoInput,
    buttonThreeInput etc etc
    I'd also like to sort the way this information goes in (just
    being able to sort by alpha right now would be fine, but better yet
    if I could sort it so button one always was in the front, button
    two always in the middle, button three always in the end)
    The end application of this is that I need to populate a
    datagrid with several different button groups, there are 5 groups,
    each group contains about 10 buttons. The groups need to appear in
    a specific order in the datagrid, and I need to be able to add as
    many button's information to the grid as possible.
    After this stuff all goes in, I need to get it back out too.
    I think I'll be able to figure that part out.
    Now, I know this is a lot of stuff. I don't even know if it's
    possible, but it seems like it should be, I've been trying to
    figure it out all day to no avail.
    Any tips / suggestions / code snippets / links to tutorials
    would be helpful.
    Thanks.

    Well, specifically. They're binded data (swfs) I need the
    ability to add as many of these as possible to a datagrid. I'll be
    extracting them and using them in a list.
    So to break it down, I've got a bunch of different strings I
    need to add to a datagrid item. I need to add these in the proper
    order. I then need to pop them back out to a list (I know how to do
    this part).
    Basically what I'm going on right now, is I'm calling a
    flashfile.source from a selected item. Then I'm adding it into a
    datagrid, I just need to know how to add it in without destroying
    the current items.
    Would something work where I'd ask for the current data
    datagrid.selectedItem.column and then also add the new data work?
    Thanks for your help miaomm, I'd really appreciate some code
    showing this .

  • How to hide blank columns in datagrid?

    Hi,
    I have a datagrid nicely populated with data.
    But I have some colums which are blank (the columns have a
    Header but the rest of its rows are blank).
    I want to hide these columns so that users can't see them.
    Note that the blank columns are not fixed. Sometimes it can
    be that a column is blank but at other times it can be filled.
    So I cannot use... "<... visible=false>
    I need to loop thru the columns and then hide the blank
    columns.
    Anyone has an idea how to code for this loop.
    Thx

    Well..from what i know, the datagrid supports the syntax to
    allow for you to specify the columns explicitly through the
    DataGridColumn. Done like this
    <mx:datagrid>
    <mx:columns>
    <mxdatagridcolumn datafield = "Column 1 name" ..>
    <mxdatagridcolumn datafield = "" ..>
    <mxdatagridcolumn datafield = "" ..>
    </mx:columns>
    </mx:datagrid>
    why dont you specify the columns you want using this. that
    way, if there is no data in the colums, that column just wont show.
    Hope i am understanding you right when you say hide blank
    columns

  • How to make spark datagrid columns to behave like mx datagrid columns

    Hello.
    I have a problem with spark datagrid component. I can't force spark datagrid columns behave like old mx datagrid columns. In mx datagrid columns fills 100% of datagrid regardles of resizing column or datagrid itself (it will not show horizontal scrolling bar). In spark datagrid last column (colC) will never word wrap, event after setting horizontalScrollPolicy=off. I would like to somehow constrain spark columns to behave like mx ones.
    App snippet (try to resize app and columns - especially colC - and you will see what I mean):
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:mx="library://ns.adobe.com/flex/mx">
        <fx:Declarations>
            <s:ArrayCollection id="dp">
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
                <s:DataItem colA="some sample data" colB="some sample data" colC="some sample data"/>
            </s:ArrayCollection>
        </fx:Declarations>
        <s:layout>
            <s:HorizontalLayout/>
        </s:layout>
        <s:DataGrid id="grid" width="100%" height="100%" dataProvider="{dp}" variableRowHeight="true" horizontalScrollPolicy="off">
            <s:columns>
                <s:ArrayList>
                    <s:GridColumn headerText="Column A" dataField="colA"/>
                    <s:GridColumn headerText="Column B" dataField="colB"/>
                    <s:GridColumn headerText="Column C" dataField="colC"/>
                </s:ArrayList>
            </s:columns>
        </s:DataGrid>
        <mx:DataGrid id="grid2" width="100%" height="100%" dataProvider="{dp}" wordWrap="true" variableRowHeight="true">
            <mx:columns>
                <mx:DataGridColumn headerText="Column A" dataField="colA"/>
                <mx:DataGridColumn headerText="Column B" dataField="colB"/>
                <mx:DataGridColumn headerText="Column C" dataField="colC"/>
            </mx:columns>
        </mx:DataGrid>
    </s:Application>

    the datagrid has sortItems and sortItemsOn methods you can use.

  • Referencing custom filled column (labelFunction) in datagrid

    I got a column in a datagrid which is filled with data using some calculations done in a labelFunction.
    now i got a second column, which need the data of the previous mentioned column.
    normally you would type:  item.Data or something, but that does not work for the calculated field.
    how would i reference the first mentioned column in the labelFunction of the second?
    thnx

    The cheap way is to reference the the other column's labelFunction and call
    it again.  It means that the labelFunction will be called twice per row.
    You can get to the columns via DataGrid(owner).columns[]
    Another possibility is to add the labelFunction to the data objects or a
    subclass of the data objects.

Maybe you are looking for

  • My iPhone 5 is not catching up my website, although having a big screen... What does it need to get the pages in auto mobile queries converting?

    my iPhone 5 is not catching up my website, although having a big screen... What does it need to get the pages in auto mobile queries converting?

  • Unable to delete the BDS attachment

    Hi, I am using the FM BDS_BUSINESSDOCUMENT_CREA_TAB in my ztable to attach file to the BO. I am able to attach the file and open it from the document but i am unable to delete the same document. Dd anyone know the solution? Pls suggest. This is my co

  • Converting bytes to unsigned bytes

          int u=0;       int i=32; byte []  data1 = new byte[1024]; int[] unsignedValue=new int[1024]; while(u<100){                     unsignedValue[u] =data1[i] & 0xff;                       u++;                       i++;                    } from in

  • Transfer video to ipad without computer/itunes

    My macbook pro recently died and I can't afford to get a replacement right now. So I would like to know if there are any apps/programs to install on my bf's computer so that I can transfer videos from his computer to my ipad without clearing my ipad.

  • Ha events = false

    What are the implications or potential hazards of turning off ha events? We are a 6 node cluster with load balancing=true, but our system locks up due to a high number of waits on library cache pins. The waits are from the EMN0 process (background pr