2 Replies Latest reply on Aug 20, 2010 4:06 AM by See Sam Jagan

    Text box in gridview

    kvpdy

      I have to show empty text box in all the columns of my grid while lodading grid. Anyone please give me the source code for this. I am new to flex.

       

      Thanks & Regards

      kvpdy

        • 1. Re: Text box in gridview
          Prestine

          Hello,

           

          when you say  grid, wat you mean by grid

           

          1] <mx:Grid>

          2] <mx:DataGrid>

           

          Regards,

          • 2. Re: Text box in gridview
            See Sam Jagan

            hi,

            try to use ItemRenderer property of the DataGridColumn Control..

             

            and make sure you set the dataProvide property something like {[{},{}]} which will give you two empty rows with

             

            <mx:DataGrid width="100%" height="300" dataProvider="{[{}, {}]}">
            <mx:columns>
                 <mx:DataGridColumn  itemRenderer="mx.controls.TextInput" headerText="Col1"/>
                 <mx:DataGridColumn itemRenderer="mx.controls.TextInput" headerText="Col2"/>
                 <mx:DataGridColumn itemRenderer="mx.controls.TextInput" headerText="Col3"/>
            </mx:columns>
            </mx:DataGrid>
            

             

            or you can try this

             

            <mx:Script>
                      <![CDATA[
                           import mx.collections.ArrayCollection;
                           [Bindable]
                           public var rdp:Array = [{}, {}, {}];
                           [Bindable]
                           public var cdp:Array = [{}, {}, {}, {}];
                      ]]>
                 </mx:Script>
                 <mx:Grid>
                      <mx:Repeater dataProvider="{rdp}">
                           <mx:GridRow>
                                <mx:Repeater dataProvider="{cdp}">
                                     <mx:GridItem>
                                          <mx:TextInput text="" width="100%"/>
                                     </mx:GridItem>
                                </mx:Repeater>
                           </mx:GridRow>
                      </mx:Repeater>
                 </mx:Grid>
            

             

            good luck