a suggestion only... we can have a header using some other component ( may be using canvas, text etc..) instead of datagrid.... do we have any advantage over using header from datagrid? We cannot sort, nor adjust the width.... If not i think we should choose some light weight component than datagrid..
*Will advanced dataGrid will help?* On Tue, Aug 18, 2009 at 5:20 PM, Ravi Mishra <ravi.achi...@gmail.com> wrote: > > Hi Anoop, > > Let me know if following works > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="absolute"> > <mx:Script> > <![CDATA[ > import mx.collections.ArrayCollection; > [Bindable] > private var ac:ArrayCollection = new ArrayCollection([ > {a:"Current",b:"Level 3" ,c:"40-60%",comments:"Capital > preservation with modest appreciation"}, > {a:"Current",b:"Level 3" ,c:"40-60%",comments:"Capital > preservation with modest appreciation"}, > {a:"Current",b:"Level 3" ,c:"40-60%",comments:"Capital > preservation with modest appreciation"}, > ]); > ]]> > </mx:Script> > <mx:VBox width="100%" verticalGap="0"> > <mx:DataGrid id="tempGridForHeadersOnly" > height="{tempGridForHeadersOnly.headerHeight}" width="100%"> > <mx:columns> > <mx:DataGridColumn headerText="a" > dataField="a"/> > <mx:DataGridColumn headerText="b" dataField="b"/> > <mx:DataGridColumn headerText="c" dataField="c"/> > </mx:columns> > </mx:DataGrid> > <mx:DataGrid width="100%" dataProvider="{ac}" > sortableColumns="false" > selectable="false" headerHeight="0" variableRowHeight="true" > paddingLeft="10" paddingRight="10"> > <mx:columns> > <mx:DataGridColumn> > <mx:itemRenderer> > <mx:Component> > <mx:VBox width="100%"> > <mx:DataGrid > width="100%" height="100%" showHeaders="false" sortableColumns="false" > rowCount="1" dataProvider="{data}" selectable="false"> > > <mx:columns> > > <mx:DataGridColumn headerText="a" dataField="a"/> > > <mx:DataGridColumn headerText="b" dataField="b"/> > > <mx:DataGridColumn headerText="c" dataField="c"/> > </ > mx:columns> > </mx:DataGrid> > <mx:Grid > width="100%"> > > <mx:GridRow width="100%"> > > <mx:GridItem width="10%"> > > <mx:Label text="Comments" fontWeight="bold"/> > > </mx:GridItem> > > <mx:GridItem width="100%"> > > <mx:TextArea width="100%" text="{data.comments}"/> > > </mx:GridItem> > </ > mx:GridRow> > </mx:Grid> > </mx:VBox> > </mx:Component> > </mx:itemRenderer> > </mx:DataGridColumn> > </mx:columns> > </mx:DataGrid> > </mx:VBox> > > </mx:Application> > > Though it's not a good approach because i have added one temporary > datagrid just for columns only. Because the case you are looking for > can not be solved using traditional datagrid in flex. You have to > customize it a bit. > > HTH, > > -Ravi > http://achieveravi.blogspot.com > > On Aug 18, 4:11 pm, Anoop Max <anoop....@oracle.com> wrote: > > Hi Ravi / Preetham, > > > > Please find the code below. > > > > <?xml version="1.0" encoding="utf-8"?> > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > > layout="absolute"> > > <mx:Script> > > <![CDATA[ > > import mx.collections.ArrayCollection; > > [Bindable] > > private var ac:ArrayCollection = new ArrayCollection([ > > {a:"Current",b:"Level 3" ,c:"40-60%", > > comments:"Capital preservation with modest appreciation"}, > > {a:"Current",b:"Level 3" ,c:"40-60%", > > comments:"Capital preservation with modest appreciation"}, > > {a:"Current",b:"Level 3" ,c:"40-60%", > > comments:"Capital preservation with modest > > appreciation"}, > > ]); > > ]]> > > </mx:Script> > > <mx:DataGrid width="100%" dataProvider="{ac}" > sortableColumns="false" > > selectable="false" headerHeight="0" variableRowHeight="true" > > paddingLeft="10" paddingRight="10"> > > <mx:columns> > > <mx:DataGridColumn> > > <mx:itemRenderer> > > <mx:Component> > > <mx:VBox width="100%"> > > <mx:DataGrid > width="100%" height="100%" sortableColumns="false" > > rowCount="1" dataProvider="{data}" selectable="false"> > > > <mx:columns> > > > <mx:DataGridColumn headerText="a" dataField="a"/> > > > <mx:DataGridColumn headerText="b" dataField="b"/> > > > <mx:DataGridColumn headerText="c" dataField="c"/> > > > </mx:columns> > > </mx:DataGrid> > > <mx:Grid > width="100%"> > > > <mx:GridRow width="100%"> > > > <mx:GridItem width="10%"> > > > <mx:Label text="Comments" fontWeight="bold"/> > > > </mx:GridItem> > > > <mx:GridItem width="100%"> > > > <mx:TextArea width="100%" text="{data.comments}"/> > > > </mx:GridItem> > > > </mx:GridRow> > > </mx:Grid> > > </mx:VBox> > > </mx:Component> > > </mx:itemRenderer> > > </mx:DataGridColumn> > > </mx:columns> > > </mx:DataGrid> > > </mx:Application> > > > > If you run this, I am getting a datagrid with datagrids inside that. > > But all the inner datagrids have headings. I want to have heading for > > the main datagrid only. > > Probably, I think I am going far away. May be it can be done in some > > other way. Even without using datagrid. > > If any idea is coming to your mind, please share. > > > > Regards, > > Anoop > > > > On Aug 18, 4:05 pm, Preetham Hegde <preethamheg...@gmail.com> wrote: > > > > > Hi Anoop, > > > > > there is a attribute called *showHeaders* for datagrid.. Check whether > it is > > > true or false.. > > > And set *headerText* dataColumn . > > > > > As Ravi told if u share ur code it would be easy to debug... > > > > > On Tue, Aug 18, 2009 at 4:10 PM, Ravi Mishra <ravi.achi...@gmail.com> > wrote: > > > > > > Hi Anoop, > > > > > > Can you pls share your code snippet with us? So that we can have a > > > > better picture. > > > > > > -Ravi > > > >http://achieveravi.blogspot.com > > > > > > On Aug 18, 2:44 pm, Anoop Max <anoop....@oracle.com> wrote: > > > > > Hi All, > > > > > > > I am working on one datagrid in which am facing one difficulty. > > > > > In the data grid, after each row, it needs to display one row which > > > > > will display comments for that particular row. > > > > > > > a | b | c | d > > > > > comments : > > > > > > > I guess itemrenderer is the answer for this, but how? I tried > putting > > > > > datagrid and text area in one hbox and making it as itemrenderer > for > > > > > the main datagrid. That worked, but I am not able to put header for > > > > > the main datagrid. Please help. > > > > > > > regards, > > > > > Anoop > > > > > -- > > > Regards, > > > Preetham Hegdewww.dizzianer.com > > > > > _______________________________________________ > > > If you only have a hammer, you tend to see every problem as a nail. > > > -- Regards, Preetham Hegde _______________________________________________ If you only have a hammer, you tend to see every problem as a nail. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to flex_india@googlegroups.com To unsubscribe from this group, send email to flex_india+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---