send me the complete file....may be i can do something with that.

-Ravi

On Mar 22, 5:38 pm, Akhil Agrawal <[email protected]> wrote:
> @ravi
> it is not working . columns is an array that provide field name in
> arraycollection for providing data to grid
>
> On Mar 21, 11:17 am, Ravi Mishra <[email protected]> wrote:
>
> > Dont declare the dcolumn as a global variable.....declare it locally
> > in the function where you are running the for loop and then push this
> > dcolumn to gridcolumns array and then finally assign this array to the
> > columns property of datagrid.
>
> > BTW what is columns in the for loop?
>
> > -Ravi
> > On Mar 20, 7:14 pm, Akhil Agrawal <[email protected]> wrote:
>
> > > [Bindable]
> > >                 private var queryResult:ArrayCollection=new 
> > > ArrayCollection();
> > >                 [Bindable]
> > >                 private var gridcolumns:Array=new Array();
> > >                 private var grid:DataGrid=new DataGrid();
> > >                 [Bindable]
> > >                 private var dcolumn:DataGridColumn=new DataGridColumn();
>
> > > for(var i:int=0;i<columns.length;i++)
> > >                                 {
>
> > >                                 //      Alert.show(colName,"col name");
> > >                                         dcolumn=new 
> > > DataGridColumn(colName.toUpperCase()); //colname is
> > > a string which is same as field in array collection
> > >                                         dcolumn.dataField=colName;
> > >                                         dcolumn.resizable=true;
> > >                                         dcolumn.minWidth=200;
> > >                                         gridcolumns.push(dcolumn);
>
> > >                                 }
> > >                                 this.grid.columns=gridcolumns;
> > >                         var temp:ArrayCollection=new 
> > > ArrayCollection(rows); // rows is an
> > > array of rows as shown in previous post
> > >          queryResult=temp;
> > >                 this.grid.dataProvider=queryResult;
>
> > > this is the code how i m  doing now plz help me in this regard
>
> > > On Mar 20, 6:23 pm, Ravi Mishra <[email protected]> wrote:
>
> > > > Can you pls send your complete code.....as I am not able to understand
> > > > what is gridColumns?
>
> > > > GridColumns should be an Array and you should loop through each
> > > > property of a row like this
>
> > > > for each(var str:string in rowObject){
> > > > // your code of creating and pushing the columns in GridColumns array
>
> > > > }
>
> > > > then assign GridColumns to grid.columns
>
> > > > HTH,
>
> > > > -Ravi
>
> > > > On Mar 20, 5:42 pm, Akhil Agrawal <[email protected]> wrote:
>
> > > > > Hi all,
> > > > > I have many rows in a arraycollection in tha form
> > > > > {'Category ID':'null', 'Software Feature ID':'null', 'Event Date':'Tue
> > > > > Mar 17 11:40:13 IST 2009', 'Event Type ID':'2102006'}
>
> > > > > where category id and other are columns and creating datagridcolumn
> > > > > like this
>
> > > > > dcolumn=new DataGridColumn(colName.toUpperCase());
> > > > > dcolumn.dataField=colName;
>
> > > > > grid.columns=this.gridcolumns; // grid is an object of datagrid type
>
> > > > > var temp:ArrayCollection=new ArrayCollection(rows);
>
> > > > > this.grid.dataProvider=temp;
>
> > > > > it is not displaying the data properply and displaying complete row as
> > > > > written above in each column
> > > > > how to fix it
>
> > > > > thank you
>
> > > > > regards
>
> > > akhil agrawal
--~--~---------~--~----~------------~-------~--~----~
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