Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

datagrid sizing

Community Beginner ,
Apr 13, 2010 Apr 13, 2010

datagrid.png

I am trying to get the textfiled of the datagrid to be big enough to fit long names, i have tried lots of different things, from applying a cellrenderer and making the textfiled wider which worked in away because you can see all the text. and the column itself has a minwidth. But the box behind does not change. How do i get access to it to make it wider?

Thanks

TOPICS
ActionScript
879
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2010 Apr 13, 2010

what's the problem when you increase the width of your dg?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 13, 2010 Apr 13, 2010

it does not increase the size of the column, just adding a big yellow space at the side, i want the white boxes, what i assumed to be the column to be the width i tell it, but it does not change. the grid is 500 wide and the name col has a min width of 400, with a cell rendered class telling it the textfield should be 400 wide too.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2010 Apr 13, 2010

did you adjust your datagridcolumn width?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 13, 2010 Apr 13, 2010

several times, eventually setting it to have a minimum width of 400, but it made no difference to the appearnce

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2010 Apr 13, 2010

you would use something like:


var dgc:DataGridColumn = yourdg.getColumnAt(0);
dgc.width = 400;

i see you've worked out a solution so you may not be interested.  but, for others, that's how it should be done.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 13, 2010 Apr 13, 2010

i am creating the columns dynamically so i thought that would be enought like

var titleCol:DataGridColumn = new DataGridColumn();

titleCol.width = 400;
myDataGrid.addColumn(titleCol);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 13, 2010 Apr 13, 2010
LATEST

that won't work and should generate error messages.  the datagridcolumn constructor requires a string is passed or a dataField property is assigned to the column before assigning the column to the datagrid.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 13, 2010 Apr 13, 2010

i have found away around or perhaps the only way, by using skins to recreate the white box, seems to work fine juts need to sort the layering

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines