Cannot create property defaultColumnCount on mx.controls.DataGrid

The app compiles fine but an error occurs at runtime.
Code:
<mx:DataGrid width="100%"
             height="100%"
             lockedColumnCount="6"
             horizontalScrollPolicy="on"
             defaultColumnCount="1">
Error:
Cannot create property defaultColumnCount on mx.controls.DataGrid
Property description:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/listClasses /ListBase.html#defaultColumnCount

it appears that datagrid does not inherite that property from listbase class or if it does its encapsulated so that is only used withing the class.
what are you trying to do. when i look a the source code for flex datagrid i saw this.
private var _columns:Array; // the array of our DataGridColumns
    [Bindable("columnsChanged")]
    [Inspectable(category="General", arrayType="mx.controls.dataGridClasses.DataGridColumn")]
     *  An array of DataGridColumn objects, one for each column that
     *  can be displayed.  If not explicitly set, the DataGrid control
     *  attempts to examine the first data provider item to determine the
     *  set of properties and display those properties in alphabetic
     *  order.
     *  <p>If you want to change the set of columns, you must get this array,
     *  make modifications to the columns and order of columns in the array,
     *  and then assign the new array to the columns property.  This is because
     *  the DataGrid control returned a new copy of the array of columns and therefore
     *  did not notice the changes.</p>
     *  @langversion 3.0
     *  @playerversion Flash 9
     *  @playerversion AIR 1.1
     *  @productversion Flex 3
    override public function get columns():Array
        return _columns.slice(0);
     *  @private
    override public function set columns(value:Array):void
        var n:int;
        var i:int;
        n = _columns.length;
        for (i = 0; i < n; i++)
            columnRendererChanged(_columns[i]);
        freeItemRenderersTable = new Dictionary(false);
        columnMap = {};
        _columns = value.slice(0);
        columnsInvalid = true;
        generatedColumns = false;
        n = value.length;
        for (i = 0; i < n; i++)
            var column:DataGridColumn = _columns[i];
            column.owner = this;
            column.colNum = i;
            if (column.cachedHeaderRenderer)
                var item:DisplayObject = column.cachedHeaderRenderer as DisplayObject
                if (item.parent)
                    item.parent.removeChild(item);
                column.cachedHeaderRenderer = null;
        updateSortIndexAndDirection();
        fontContextChanged = true;
        invalidateProperties();
        itemsSizeChanged = true;
        invalidateDisplayList();
        dispatchEvent(new Event("columnsChanged"));
its ovbious to me that flex is calculating how many columns will appear on the datagrid depending on the dataprovider you supply.
Or if you would like to only show a specific amount of columns  you can futher define them in your grid like so
<mx:DataGrid  id="grid" columnCount="2">
  <mx:columns>
<mx:DataGridColumn headerText="column1"/>
<mx:DataGridColumn headerText="column2"/>  
</mx:columns>
  </mx:DataGrid >

Similar Messages

  • Cannot create property rotationX on mx.controls.Image

    This seems to be a fairly general error message and I am not
    sure why it is happening. I updated the settings in Eclipse to use
    Flex 3.2. I can't figure out why the debugger is erroring out when
    I call myImage.rotationX = 45 on a simple image ccontrol.
    Any ideas? I'm trying to learn some of the new display stuff.
    Thanks
    Kyle

    Here is the basic code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:WindowedApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    public function init():void
    theImage.rotationX = 45;
    ]]>
    </mx:Script>
    <mx:Image id="theImage" />
    </mx:WindowedApplication>

  • Setting executeInBackground = true on iOS Cannot create property error

    I'm using Flash Builder 4.7, created a Flex Mobile project.
    When my application deactivates, it needs to send a single POSt HTTP request to my server. It takes a few milliseconds to send, and on Android it works just fine. However, on iOS, since the app is suspended, the request is not sent until I activate the app again.
    I've looked online and tried this solution:
    adding the line
        NativeApplication.nativeApplication.executeInBackground = true;
    In the home view, or just before sending the request, raises an exception:
    ReferenceError: Error #1056: Cannot create property executeInBackground on flash.desktop.NativeApplication.
              at views::BnpSampleHomeView$cinit()
              at global$init()
              at BnpSample()[C:\eclipse\projects\BnpSample\src\BnpSample.mxml:3]
              at _BnpSample_mx_managers_SystemManager/create()[_BnpSample_mx_managers_SystemManager.as:51]
              at mx.managers.systemClasses::ChildManager/initializeTopLevelWindow()[E:\dev\4.y\frameworks\ projects\framework\src\mx\managers\systemClasses\ChildManager.as:311]
              at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\4.y\frameworks\projects\fram ework\src\mx\managers\SystemManager.as:3057]
              at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::kickOff()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2843]
              at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::preloader_completeHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2723]
              at flash.events::EventDispatcher/dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at mx.preloaders::Preloader/timerHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\p reloaders\Preloader.as:542]
              at flash.utils::Timer/_timerDispatch()
              at flash.utils::Timer/tick()
    Help is apprecaited

    Some parts of this topic may be of help:
    http://forums.adobe.com/message/4359474

  • Error #1056: Cannot create property __id0_ on ModuleSwf

    I have a document class for a SWF. This SWF compiles and runs fine.  When I load it inside another SWF, I get this:
    ReferenceError: Error #1056: Cannot create property __id0_ on ModuleSwf.
              at flash.display::Sprite/constructChildren()
              at flash.display::Sprite()
              at flash.display::MovieClip()
              at ModuleSwf()
    ModuleSwf is the document class of the loaded SWF.  What is causing this?

    ReferenceError: Error #1056: Cannot create property __id0_ on ModuleSwf.
              at flash.display::Sprite/constructChildren()
              at flash.display::Sprite()
              at flash.display::MovieClip()
              at ModuleSwf()[C:\Users\me\Projects\MyProject\Production\Assembly\classes\ModuleSwf.as:17]
    package
              import flash.display.DisplayObject;
              import flash.display.MovieClip;
              import flash.events.Event;
              public class ModuleSwf extends MovieClip
              {   // This is line 17
                public function ModuleSwf()
                                  if (this != root)
                                            stop();
                                  addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler, false, 0, true);
                                  addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler, false, 0, true);

  • Arrgh! this is killing me!  ReferenceError: Error #1056: Cannot create property x_MC on document cla

    Oh man! jsut when i thought I w'as getting somewhere! I thought I had my load and unload code sorted and now I am getting this error for a particular .swf that I am trying to load. the loader code is working fine, it will load a test.  The particular.swf works fine on its own, but it wont load for some reason! Argh!!!!! AM I just a total $%#^%# idiot or waht! This process has been like having my eyeballs extracted by ants!
    Please please help
    ReferenceError: Error #1056: Cannot create property write_visionMC on aavar.
              at flash.display::Sprite/constructChildren()
              at flash.display::Sprite()
              at flash.display::MovieClip()
              at aavar()
    write_visionMC is the a movieclip inside the .swf I am trying to load    aavar() is my docuemnt class

    use the trace() function to debug.  start by confirming that your document class'es constructor is being called.  then use traces to make sure your movieclip exists before it's being referenced.

  • Need urgetn help: ReferenceError: Error #1056: Cannot create property btnEnterJ on mmquizzingv4_as3.

    I created random quiz with 20 questions and tested it at www.scorm.com for scorm compliance testing. When I launch the course, i get the below error message. If I select continue and proceed to the quiz, after answering few question, randomly submit button for one of the questions is getting disabled. Please help.
    ERROR MESSAGE:
    ReferenceError: Error #1056: Cannot create property btnEnterJ on mmquizzingv4_as3.mmquizclasses.SubmitButton.
        at flash.display::Sprite/constructChildren()
        at flash.display::Sprite()
        at flash.display::MovieClip()
        at captivate.veela_as3::rdBase()
        at captivate.veela_as3::rdItem()
        at mmquizzingv4_as3.mmquizclasses::QuestionButton()
        at mmquizzingv4_as3.mmquizclasses::SubmitButton()
        at flash.display::Sprite/constructChildren()
        at flash.display::Sprite()
        at flash.display::MovieClip()
        at mmquizzingv4_as3.mmquizclasses::Question()
        at flash.display::Sprite/constructChildren()
        at flash.display::Sprite()
        at flash.display::MovieClip()
        at captivate.veela_as3::rdBase()
        at captivate.veela_as3::rdSlide()
        at captivate.veela_as3::rdQPSlide()

    I got the code when I up graded to Adobe air and it has a conflect with accure weather..... Looks like someone attached it to the upgrade to Adobe 8
    Enter the code in the Adobe support search web page and you get another erro code not in English....hummmm   Google comes up on the support button
    to reg the google internet browers I did and google came up and I type in the adobe 1056 error...Over 5 third party free fixes came up???? Windows 7
    didn't like anyone of them.......I called Adobe support and no help for free......I uninstalled the Adobe Air and the error went away along with adobe Air...
    It seems everyone else knows there is a problem but Adobe???? I love Adobe.....I don't like there lack of Training their customer support people....

  • Error #1056: Cannot create property text on String.

    Ok, i fixed the last error message, but i still cant get the xml to load, I am getting this error message now
    What does this mean, I can't seem to figure it out.
    I am trying to load the title of a video reel onto a button
    and load a corresponding move, 1 of 4...getting this error now
    ReferenceError: Error #1056: Cannot create property text on String.
        at main2_fla::MainTimeline/setVids()
        at main2_fla::MainTimeline/xmlLoaded()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/onComplete()
    this is the correspoding codeits referring to:
    function setVids():void {
        for(var i = 0; i < 3; i++) {
            var name_txt:String = vidList_XML.vid[i + count].file;
            var reelTitle = this["vid" + (i + 1)].name;
            reelTitle.text = name_txt;

    It is telling you that you can't create a property called "text" on an instance of the String class.
    var reelTitle = this["vid" + (i + 1)].name;
    That is assigning the name property of this["vid"+(i+1)] to the variable reelTitle. You haven't typed the variable, but "name" properties are always Strings, so reelTitle is a String.
    And the String class is not dynamic, so you can't just go adding properties to it.
    My guess is that you want something like this:
    var reelTitle:TextField=this.getInstanceByName("vid"+(i+1))
    reelTitle.text=name_txt
    Or something like that....

  • Error #1056: Cannot create property allowCodeImport on flash.system.LoaderContext.

    Runs good at browser but running directly on flash player causes this error.Error #1056: Cannot create property allowCodeImport on flash.system.LoaderContext.

    Isn't this a question for the Flash Player forum?
    http://forums.adobe.com/community/flashplayer

  • ReferenceError: Error #1056: Cannot create property

    Hello,
    I have been playing around with passing objects between Flex and BlazeDS.
    I have a Java VO:
    package vo;
    import java.util.Date;
    import java.util.Set;
    public class TestVO
    private long aInt;
    private double aDouble;
    private boolean aBool;
    private Date aDate;
    private String aString;
    private Set aSet;
    public void setAInt(long aInt)
    this.aInt = aInt;
    public long getAInt()
    return aInt;
    public void setADouble(double aDouble)
    this.aDouble = aDouble;
    public double getADouble()
    return aDouble;
    public void setABool(boolean aBool)
    this.aBool = aBool;
    public boolean isABool()
    return aBool;
    public void setADate(Date aDate)
    this.aDate = aDate;
    public Date getADate()
    return aDate;
    public void setAString(String aString)
    this.aString = aString;
    public String getAString()
    return aString;
    public void setASet(Set aSet)
    this.aSet = aSet;
    public Set getASet()
    return aSet;
    and the corresponding ActionScript VO:
    package vo
    import mx.collections.ArrayCollection;
    [Bindable]
    [RemoteClass(alias="vo.TestVO")]
    public class TestVO
    public var aInt : int;
    public var aDouble : Number;
    public var aBool : Boolean;
    public var aDate: Date;
    public var aString : String ;
    public var aSet : ArrayCollection = new ArrayCollection();
    When passing an instantiated object back from java I get these errors in the console:
    ReferenceError: Error #1056: Cannot create property AString on vo.TestVO.
    ReferenceError: Error #1056: Cannot create property AInt on vo.TestVO.
    ReferenceError: Error #1056: Cannot create property ASet on vo.TestVO.
    ReferenceError: Error #1056: Cannot create property ADouble on vo.TestVO.
    ReferenceError: Error #1056: Cannot create property ABool on vo.TestVO.
    ReferenceError: Error #1056: Cannot create property ADate on vo.TestVO.
    If I change my ActionScript VO to the following it works:
    package vo
    import mx.collections.ArrayCollection;
    [Bindable]
    [RemoteClass(alias="vo.TestVO")]
    public class TestVO
    public var AInt : int;
    public var ADouble : Number;
    public var ABool : Boolean;
    public var ADate: Date;
    public var AString : String ;
    public var ASet : ArrayCollection = new ArrayCollection();
    I dont particulary want to use this naming convention for my variables. Making the Java variables public also works but I dont want to do this either?
    Is there anything I can do or is this the way it is?
    Cheers

    Hey try this in your actionscript code
    package vo
    import mx.collections.ArrayCollection;
    [Bindable]
    [RemoteClass(alias="vo.TestVO")]
    public class TestVO
    private var _aInt:int;
    private var _aDouble:Number;
    private var _aBool:Boolean;
    private var _aDate:Date;
    private var _aString:String;
    private var _aSet:ArrayCollection = new ArrayCollection();
    public function get aInt():int{return _aInt;}
    public function set aInt(aInt:int):void
    this._aInt = aInt;
    public function get aDouble():Number{
    return _aDouble;
    public function set aDouble(aDouble:Number):void{
    this._aDouble = aDouble;
    public function get aDate():Date{return this._aDate;}
    public function set aDate(aDate:Date):void{
    this._aDate = aDate;
    public function get aString():String{return this._aString;}
    public function set aString(aString:String):void{
    this._aString = aString;
    public function get aSet():ArrayCollection{return this._aSet;}
    public function set aSet(aSet:ArrayCollection):void{
    this._aSet = aSet;
    ---That should work cos I had the same problem today and that was how I solved it.
    --Patrick

  • ReferenceError: Error #1056: Cannot create property 0 on Number.

    Hi, I have an AS3 script that calls an XML but when compiling I get this error
    ReferenceError: Error #1056: Cannot create property 0 on Number.
    at mod::ML/parseData()
    at mng::DM/onXMLLoaded()
    Here are some snippets
    the first script that defines the XML
            private function addedToStageHandler(event:Event = null) : void
                var _loc_2:* = Application.getInstance();
                Application.xmlPath = "xml/soc.xml";
                _loc_2.initialize(this);
                return;
    here is the ML one
        public class Model extends EventDispatcher implements IModel
            public var social:Social;
            public function Model()
                return;
            public function parseSocialData(param1:XML) : void
                this.social = new Social(param1);
                this.socialSection.social = this.social;
                return;
            public function getSectionData(param1:String) : Absec
                var _loc_2:Absec = null;
                switch(param1)
                    case "SocialSection":
                        _loc_2 = this.socialSection;
                        break;
                return _loc_2;
            public function parseData(param1:XML) : void
                this.socialSection = new SocialSection(XML(_loc_3));
                var _loc_4:int = 0;
                var _loc_5:* = xml.sections.section;
                var _loc_3:* = new XMLList("");
                for each (_loc_6 in _loc_5)
                    var _loc_7:* = _loc_5[_loc_4];
                    with (_loc_5[_loc_4])
                        if (@id == "SocialSection")
                            _loc_3[_loc_4] = _loc_6;
    here is the DM one
            private function onXMLLoaded(event:Event) : void
                var _loc_2:* = new XML(event.target.data);
                this.model.parseData(_loc_2);
                dispatchEvent(new Event(XML_LOADED));
                return;
    and the XML
      <section id="SocialSection" active="true" visible="true" default="false">
       <name><![CDATA[<font size="50">SOCIAL</font>]]></name>
       <title><![CDATA[<font size="25">SOCIAL</font>]]></title>
       <forums>
        <line1><![CDATA[<font size="10">POST ON THE</font>]]></line1>
        <line2><![CDATA[<font size="18">FORUMS</font>]]></line2>
        <rollover><![CDATA[<font size="10">Have questions? Click here.</font>]]></rollover>
        <url>link_to_forum</url>
       </forums>
      </section>
    I think the issue is _loc_4 but not sure how to fix this. Thanks!

    Hi, thanks for your reply. I did as you suggested and the error is here for ML
                            _loc_3[_loc_4] = _loc_6;
    and here for DM
                this.model.parseData(_loc_2);
    And it's more cryptic than before : ). I think the DM error is predictable because of the first one
    The complete error list is
    ReferenceError: Error #1056: Cannot create property 0 on Number.
    at mod::ML/parseData()
    at mng::DM/onXMLLoaded()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    again, I think everything starts with ML script error
    Thanks!

  • ReferenceError: Error #1056: Cannot create property...IEditManager::delayedOperations

    When I compile a somewhat complex application, I immediately get the following error:
    ReferenceError: Error #1056: Cannot create property flashx.textLayout.edit:IEditManager::delayedOperations on flashx.textLayout.edit.EditManager.
    But when I compile one of the TLF’s sample projects, I do not receive this error.
    I am using the following:
    Flex SDK: 4.5.0.17689 (build date: Oct 24, 2010)
    TLF:  build 232
    I came across this post back in November 17, 2010 and as rdermer mentioned, this issue got addressed in build 204.   This change is also documented in the TLF’s ReleaseNotes.txt file.  But I am not sure why it’s happening again.  I am using the latest available builds without building the SDK and TLF locally?

    If you are referring to the latest Flex Hero as the 4.5.0.19786 build, that was posted on Thu Feb 3, 2011, then that is the build that I am having issues with.
    I am not sure what you mean by, "... and use the binaries from there...".   What binaries are you referring to?  And when I have these binaries where would I use them?  As I mentioned in my second post of this thread, I used the 19786 build in FlashBuilder and it doesn't even attempt to compile on application.  Evidently its missing compilers.
    At any rate, now I am using the build that is listed before 19786 with no issues.  I replaced the textLayout SWC with the latest one on sourceforge.

  • Error #1056: Cannot create property metaClass

    Hello,
    I've been working on integrating an app between Grails, Flex and BlazeDS. Unfortunately, I keep running into an ' ReferenceError: Error #1056: Cannot create property metaClass' error. Googling hasn't really yielded much of a result and I'm not sure what to do at this point. Could anyone help?
    Thanks in advance.

    Any ideas so far anyone?

  • ReferenceError: Error #1056: Cannot create property handler

    After updating my lcds application to LCSD 4.6  I get many of these errors. In debug log I can see, that java sends this handler property for some objects, e.g.
    (com.mm_katalogy.model.MutaceStrankyDTO_$$_javassist_40){id=4} (1675022032) {
                id = 4
                nazev_stranky = 4
                seznam_oddeleni = [] (class: org.hibernate.collection.PersistentSet)
                fk_katalog_verze = 1
                handler = [email protected]4da
    But in my actionscript DTO objects there is no such property. How could I fix this?

    If you are referring to the latest Flex Hero as the 4.5.0.19786 build, that was posted on Thu Feb 3, 2011, then that is the build that I am having issues with.
    I am not sure what you mean by, "... and use the binaries from there...".   What binaries are you referring to?  And when I have these binaries where would I use them?  As I mentioned in my second post of this thread, I used the 19786 build in FlashBuilder and it doesn't even attempt to compile on application.  Evidently its missing compilers.
    At any rate, now I am using the build that is listed before 19786 with no issues.  I replaced the textLayout SWC with the latest one on sourceforge.

  • Cannot create controls/constants/indicators from XML parser

    Is there any reason I cannot create (by right clicking) a control/constant/indicator of a XML ref from the XML parser function? I need to make subvi's to build/read xml files, and that is really impossible without that ability.
    Labview 2012 f3
    Solved!
    Go to Solution.

    This bug has already been reported (CAR 357092), and is scheduled to be fixed in the next service pack release. For now, here's a workaround:
    1. Create a reference indicator from Functions » Programming » File I/O » XML » XML Parser » New.vi.
    2. Right click on the new "DOM Document Out" indicator terminal and select Create > Control (or Indicator).
    3. Right click on the new control/indicator and choose Select XML Parser Class. Then, you can select whatever class you need.
    Darren Nattinger, CLA
    LabVIEW Artisan and Nugget Penman

  • Runtime error: Cannot create cacheAsBitmapMatrix on Sprite. Mac player 11,5,500,104

    ReferenceError: Error #1056: Cannot create property cacheAsBitmapMatrix on flash.display.Sprite.
              at Shell/create()[/Users/ujensga/Poptropica/repos/pop2/trunk/src/Shell.as:275]
              at Shell/init()[/Users/ujensga/Poptropica/repos/pop2/trunk/src/Shell.as:253]

    Did this used to work before Flash Player 11.5?
    According to the ActionScript docs, cacheAsBitmapMatrix is an AIR-only method.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayOb ject.html#cacheAsBitmapMatrix
       cacheAsBitmapMatrix
    property
    cacheAsBitmapMatrix:Matrix
    Language Version:
    ActionScript 3.0
    Runtime Versions:
    AIR 2.0
    If non-null, this Matrix object defines how a display object is rendered when cacheAsBitmap is set to true. The application uses this matrix as a transformation matrix that is applied when rendering the bitmap version of the display object.
    AIR profile support: This feature is supported on mobile devices, but it is not supported on desktop operating systems. It also has limited support on AIR for TV devices. Specifically, on AIR for TV devices, supported transformations include scaling and translation, but not rotation and skewing. See AIR Profile Support for more information regarding API support across multiple profiles.
    With cacheAsBitmapMatrix set, the application retains a cached bitmap image across various 2D transformations, including translation, rotation, and scaling. If the application uses hardware acceleration, the object will be stored in video memory as a texture. This allows the GPU to apply the supported transformations to the object. The GPU can perform these transformations faster than the CPU.
    To use the hardware acceleration, set Rendering to GPU in the General tab of the iPhone Settings dialog box in Flash Professional CS5. Or set the renderModeproperty to gpu in the application descriptor file. Note that AIR for TV devices automatically use hardware acceleration if it is available.
    For example, the following code sends an untransformed bitmap representation of the display object to the GPU:

Maybe you are looking for

  • How to generate graphs from csv file and show on remote clients?

    Hi, I have set of csv files. Each file has 104 parameters. From these parameters different graphs have to be generated and displayed to remote clients thru tomcat. Can anyone tell me how to do that? cheers, its reeju

  • I can't see my pictures in teh finder using Quick look or Cover flow

    I have iPhoto8 installed and it works fine, but I cannot get a look at my library of photos without opening iPhoto. I thought I was supposed to be able to use the finder and cover flow to see my pictures quickly to find the one I wanted without openi

  • Write Off Stock Provided To Vendor

    Hi all Could anyone please tell me what movement type to use to write off stock that is showing as provided to vendor. Thanks

  • Redirect to my own search page

    Within are site, we allow users to search for people, site, etc. When People is selected I want them to go to a custom page that I created. Where can I redirect them to my custom result page and then have that page populate with the results for the p

  • Issues exporting QuickTime movie

    Hello there, I am working on a video project that includes HD video and still images. When I export my project to a QuickTime movie (either compressed or not) it always shows some kind of really strange jumps repeats one or the other image of the sam