0 Replies Latest reply on May 8, 2007 12:49 AM by rajeeva_nagaraj

    Problem in setting dataprovider for a dynamically generated datagrid

    rajeeva_nagaraj Level 1
      Hi everybody

      I have a issue in flex, I am generating datagrids dynamically by using repeaters but i am unable to set a seperate dataprovider for each grid

      Grid1 might come with some set of data and grid 2 with some and so on so i want to set dataproviders at runtime for each grid how can i do that
      i have pasted my code for generating datagrid dynamically plz go thru that and find me some solution

      <mx:Repeater id="ProjectNames" dataProvider="{GetTimeSheetDetails.lastResult.NewDataSet.Table1}" >
      <mx:Canvas label="{ProjectNames.currentItem.ProjectName}" width="100%" height="251" id="CanvasTimeSheet" creationComplete="disablecanvas();">
      <mx:DataGrid x="10" y="10" width="864" height="206" editable="true" dataProvider="{GetTimeSheetDetails.lastResult.NewDataSet.Table}" id="dgTimeSheet">
      <mx:columns>
      <mx:DataGridColumn headerText="Task" dataField="TaskName" width="60" >
      </mx:DataGridColumn>
      <mx:DataGridColumn headerText="Task Description" dataField="TaskDescription" width="150" editable="true"/>
      <mx:DataGridColumn headerText="M" dataField="Monday" width="15" editable="true"/>
      <mx:DataGridColumn headerText="T" dataField="Tuesday" width="15" editable="true"/>
      <mx:DataGridColumn
      </mx:columns>
      </mx:DataGrid>
      <mx:Label x="564" y="222" text="0" width="35" textAlign="right" id="lblMonday" />
      <mx:Label x="602" y="222" text="0" width="33" textAlign="right" id="lblTuesday"/>

      </mx:Canvas>
      </mx:Repeater>
      </mx:TabNavigator>