views:

148

answers:

5

I've got a Grid whose GridItems contain another DataGrids. (= the DataGrid are nested in the Grid). Now I changed the Grid's horizontalGap-StyleProperty to zero. But because there are several DataGrids in one GridItem, there is still about 5-10px spacing in between those DataGrids.

How to get rid of these spacings ? Thx

A: 

Hi,

it would be great if you can post the code of at least one grid item.

Thanks, Anoop

Anoop
A: 

Here an picture of the problem. linkToImage

The DataGrid-Items(white) measure 1/3 of the width of the GridItem, in which they are in. You can see the spacing in between the dataGrids and how it affects(dark-brown) the Grid. There should no spacing in between the dataGrids…

And here would be a minimalistic code example of my problem:

var grid:Grid = new Grid();
var gridRow:GridRow = new GridRow();
var gridItem:GridItem = new GridItem();

// the DataGrid which will be nested into the grid               
var dataGrid:DataGrid = new DataGrid();
var item1:String = “exampleItem1”;
var dataGridColumnArray:Array = new Array();
var obj1:Object = {dItem:item1};
var objArray:Array = new Array();
objArray.push(obj1)
dataGridColumn.dataField = “dItem”;
dataGriColumnArray.push(dataGridColumn);
dataGrid.dataProvider = objArray;
dataGrid.columns = dataGriColumnArray;

//No spacing in the Grid
grid.setStyle(“horizontalGap”, 0);

//Nesting the DataGrid into the Grid
gridItem.addChild(dataGrid);
gridRow.addChild(gridItem);
grid.addChild(gridRow);

In this example there is just one DataGrid nested into the Grid. Originally I have at least three of them, and there is still spacing in between those.

Thanks a lot

algro
A: 

try removing the padding on the DataGrids

Gregor Kiddie
I tried that, but there is no default padding for the dataGrid.?
algro
It inherits from ListBase, which has got padding styles.
Gregor Kiddie
A: 

You can't it's not natively build in

DJ
A: 

Use an HBox and set the gap to 0 (or 1 for a small gap)

Jamie