DataGrid 怪癖中的固定行宽 [英] fixed row width in DataGrid quirk

查看:28
本文介绍了DataGrid 怪癖中的固定行宽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了这个问题:我有一个 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;

不起作用(宽度约为 40 像素):

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...

推荐答案

过去对我们有帮助的一件事:在数据网格列上设置任何宽度之前,将水平滚动策略设置为on".设置宽度后,您可以将其设置回关闭"或自动".

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 列宽问题

这篇关于DataGrid 怪癖中的固定行宽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆