Really thanks for understanding my post and your reply.
<dg>
<row>
<c1>1</c1>
<c2>2</c2>
<c3>3</c3>
</row>
<row>
<c1>a</c1>
<c2>b</c2>
<c3>c</c3>
</row>
<row>
<c1>!</c1>
<c2>@</c2>
<c3>#</c3>
</row>
</dg>;
here is the exact xml format;
I'd receive same number of columns for each row, it might 2 or 3 or 20
whatever, what i want exactly here is, i have to set the column tags
names C1, C2, C3 as the header of my datagrid, and the data in the
datasection. all the things has to happen dynamically.
have you understood my question? if not revert back :-)
On Oct 17, 8:37 pm, "Venkat Viswanathan" <[EMAIL PROTECTED]>
wrote:
> Hi Mayur,
>
> A few questions:
> - What exactly will be your XML format look like?
> - Will you have a grouping above C1, C2 and C3? If yes, you will have to use
> AdvancedDataGrid.
>
> You will have to create the DataGridColumns dynamically and assign the
> dataField to the required objects in your arrayCollection.
>
> Have a look at the attached MXML. This could act as a starting point. We can
> get your doubts cleared once you answer the questions above.
>
> Regards,
> Venkat
>
> On Fri, Oct 17, 2008 at 5:19 PM, mayur khan <[EMAIL PROTECTED]>wrote:
>
>
>
> > hi all,
> > I have a doubt here with object properties and ArrayCollection.
> > i have an xml for my datagrid like the following tree
>
> > DataGridSrc
>
> > row row row row
>
> > c1 c2 c3 c1 c2 c3 c1 c2 c3 c1 c2 c3
>
> > the column node names i,e C1, C2, C3 has to come as the header for my
> > datagrid. based on the number of rows, the data has to come in the
> > data part of my datagrid. we can achieve this very easily with static
> > coding techniques.
> > but i want it dynamically. because i don't know how many columns will
> > i have in the result xml. based on the number of columns in the xml, i
> > have to render my datagrid.
>
> > (for better understanding., for the above tree xml, datagrid will have
> > 3 columns, if i change the number of columns in the xml, i want to
> > replicate that much columns in the datagrid, with the header field of
> > the column name what i mention in the xml's column node name)
>
> > What i have tried is,
>
> > for each(row in xml.rows)
> > {
> > for each( col in row.childeren)
> > {
> > create a new object;
> > get the children_name
> > object.children_name= col.toString() // I'm clever i think,
> > so only it fails here
> > }
> > push that object to an array
> > }
>
> > display that array : [object : Object].....
>
> > very big misunderstanding of object's concepts i think.
>
> > so people, please help me out to convert XML to well defined
> > ArrayCollection
>
> > Thanks
>
>
>
> DynamicHeader.mxml
> 1KViewDownload
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---