Hello Everyone,
I have a nice looking UltraGrid with a few columns of buttons. But the buttons like pretty bad because there is no padding between them.
Can I add cell padding / spacing between columns / rows or individual cells??
Thanks,
Hi,
There's no property setting to allow you to apply padding to a single cell or column. I suppose you might be able achieve what you want using a CreationFilter.
What kind of button are you referring to here? Are you setting the Style of a column to Button and you want padding around the button? Or is this a dropdown button or an EditButton or an EditorButton?
So, what is the solution for setting padding for button in cell provided that the size of the other cells will remain unchanged?
CellSpacing is on the Override, which means it applies to the entire band. There is no way to apply it to a single column. The Layout you refer to here is abackward pointer to the grid's Layout. So this loop is just setting the same property on the same object many tmies over.
Thanks for the reply. That solution is close to what I need but it makes all of the other columns in the UltaGrid have the identical cell padding or cell spacing which looks pretty bad...
This is the code I'm using - it adds some nasty gray space between the text content and the cell wall of all the other cells - I'm trying to eliminate that gray space with the else condition - I tried values of -1, 0 and 1 and all are ignored.
//HOW TO MAKE THE BUTTONS NOT FLUSH WITH THE CELL WALLS???
{
ultraGridColumn.Layout.Override.CellSpacing = 4;
}
else
ultraGridColumn.Layout.Override.CellSpacing = -1;
Yes. Check out the CellPadding and / or CellSpacing property on the grid.DisplayLayout.Override.