固定行宽在数据网格怪癖怪癖、网格、数据

由网友(i 大众男妓。)分享简介:我有这个问题:我有一个DataGrid的地方,每当我把字段设置为不可调整大小,宽度被搞砸了; I've got this issue:I've got a dataGrid where whenever I set the column to not be resizable, the width gets me...

我有这个问题: 我有一个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设置horizo​​ntalScrollPolicy。你可以将其设置回关或自动后,设置宽度。

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.

请参阅本:Flex 3 DataGrid列宽度问题

阅读全文

相关推荐

最新文章