0 Replies Latest reply on Oct 13, 2011 6:45 AM by PaddyMc2010

    Datagrid Drop Down Item renderer Scroll Problem

    PaddyMc2010

      Hi,

       

      I am having a problem with an drop down item renderer on a Datagrid.  When ever the datagrid is displayed and the cell is clicked on i want this to display a drop down list of objects.  I can get the drop down to appear with the list of objects.  H

       

      owever the scrollbar does not work on this item to allow the user to scroll through all the objects.  If you use the mouse wheel you can scroll down through them all but not when you try and click on the scroll bar to drag down.  Below is the code used.  Any advice why this might be happening??

       

       

      <mx:DataGridColumn headerText="Widget"
      dataField="WidgetName"
      editable="true"  headerWordWrap="false" textAlign="center" width="100"
      editorDataField="Widget">
      <mx:itemEditor>
      <fx:Component>
      <s:MXDataGridItemRenderer focusEnabled="true" height="22" >
      <fx:Script>
      <![CDATA[               
      import mx.events.FlexEvent;
      import spark.events.IndexChangeEvent;

      private var selectedWidget:Widget = null;

      public function get ccyPair():String {
      return  ddlCcyPairs.selectedItem.Widget;
      }

      override protected function commitProperties():void {
      super.commitProperties();                
      trace("Commit .......");
      }

      protected function ddlCcyPairs_changeHandler(event:IndexChangeEvent):void {
      for each(var ccyP:CurrencyPair in ddlCcyPairs.dataProvider) {
      if (ccyP.ccyPair == ddlCcyPairs.selectedItem.ccyPair) {
      selectedWidget = ccyP;
      }
      }       
      ddlCcyPairs.selectedItem = selectedWidget;
      }

      protected function ddlCcyPairs_creationCompleteHandler(event:FlexEvent):void {                 
      for each(var ccyP:CurrencyPair in ddlCcyPairs.dataProvider) {
      if (ccyP.ccyPair ==  data.ccyPairName) {
      selectedWidget = ccyP;
      }
      }
      ddlCcyPairs.selectedItem = selectedWidget;
      }
      ]]>
      </fx:Script>

      <s:DropDownList id="ddlWidgets" width="100%"
      dataProvider="{parentApplication.Widgets}"
      labelField="name"              
      selectedItem="selectedWidget"
      creationComplete="ddlWidgets_creationCompleteHandler(event)"
      change="ddlWidgets_changeHandler(event)"/>
      </s:MXDataGridItemRenderer>
      </fx:Component>
      </mx:itemEditor>
      </mx:DataGridColumn>