固定行宽在数据网格怪癖 [英] fixed row width in DataGrid quirk
问题描述
我有这个问题: 我有一个DataGrid的地方,每当我把字段设置为不可调整大小,宽度被搞砸了;
I've got this issue: I've got a dataGrid where whenever I set the column to not be resizable, the width gets messed up;
作品:
var myCol:DataGridColumn = new DataGridColumn("Title");
myCol.width = 180;
不工作(宽度约40pixels):
doesn't work (width is about 40pixels):
var myCol:DataGridColumn = new DataGridColumn("Title");
myCol.width = 180;
myCol.resizable = false;
有没有人遇到这样或知道为什么会这样?
has anyone come across this or know why this is happening?
我准备好了,现在只是创建自己的DataGrid类...
I'm ready to just create my own dataGrid class now...
推荐答案
这帮助我们在过去的一件事:在你上一个DataGrid列设置任何宽度,为on设置horizontalScrollPolicy。你可以将其设置回关或自动后,设置宽度。
One thing that has helped us in the past : Before you set any width on a datagrid column, set the horizontalScrollPolicy to "on". You can set it back to "off" or "auto" after you set the width.
请参阅本:<一href="http://stackoverflow.com/questions/1302522/flex-3-datagrid-column-width-problem/6103088#6103088">Flex 3 DataGrid列宽度问题
这篇关于固定行宽在数据网格怪癖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!