当Datagrid数据多时会出现滚动条,设置selectedIndex位置后,滚动条并不能根据Datagrid选中行的位置进行偏移。

 

这时候可使用verticalScrollPosition属性

 

AS:
    protected function btn_clickHandler(event:MouseEvent):void
            {
                dgComplaints.selectedIndex=int(txt.text);
                dgComplaints.verticalScrollPosition=dgComplaints.selectedIndex;
            }


MXML:
<s:TextInput  />
        </mx:columns>
    </mx:DataGrid>
Flex 学习笔记 Datagrid中选中某行时光标定位

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2022-12-23
  • 2021-08-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-22
  • 2021-08-26
  • 2021-11-30
相关资源
相似解决方案