Adding information dynamically to datagrid

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Adding information dynamically to datagrid

    Alright, so I can get columns to dynamically add. Now I'd like to add in some
    information that will be changing dynamically. Here's The code I've got. It's
    returning a 1050 error, I think the error is because selectedItem is looking
    for something specific. By the way, I am trying to add this to a specific
    column. I might just be setting this whole application up backwards.


    public function addInfo():void {
    var source:Object = fLargeIcon.source;
    var runner:String = ".icon" + (dataGrid.columns.length + 1);
    (dataGrid.selectedItem + runner) = source;
    }

    Dizzia Guest

  2. Similar Questions and Discussions

    1. Adding controls dynamically to a datagrid
      Hi, We have a requirement, where based on the UI type selected in a dropdown, a control should get added to the column of a grid dynamically. For...
    2. Flex 2.0 Dynamically adding columns to a DataGrid (worked in 1.5)
      I have code that works fine in v1.5 to add columns to a mx.controls.DataGrid but there is no method addColumn() in 2.0 Any help on this would be...
    3. Dynamically adding DataGrid columns
      Hi, Does anyone know how to add columns dynamically to a DataGrid. i populate the grid using the .ItemDataBound the current structure of my...
    4. Dynamically adding checkboxes to a dynamic datagrid
      I am stumped. How do you add a checkbox dynamically to a datagrid that is built dynamically and then added to a panel control? Thanks in advance.
    5. Adding Columns to Datagrid Dynamically
      Hello Everyone, I have a webpage with three link buttons and a datagrid. I would like to populate the same datagrid with different datasources by...
  3. #2

    Default Re: Adding information dynamically to datagrid

    I dynamically create an arraycollection to feed a DG.

    var w:ArrayCollection = new ArrayCollection();
    var newObj:Object = {} ;
    newObj["id"] = some_dynamic_value;
    newObj["firstname"] = some_other_dynamic_value;
    newObj["lastname"] = again_some_dynamic_value;
    w.addItem(newObj);


    This will create the arraycollection items 1 by 1 if you have the above code
    (after Arr Coll w is created) in a loop like I do.
    I then make w the DG dataprovider and bobs your uncle...


    peterskeeter Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139