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,
Thank yo so much, Mike. It works fine.
Oh, so you are doing the opposite of what the original poster in this thread asked. Okay... that's pretty easy to do with a CreationFilter.
private void Form1_Load(object sender, System.EventArgs e) { this.ultraGrid1.CreationFilter = new ButtonCreationFilter(); }
public class ButtonCreationFilter : IUIElementCreationFilter { void IUIElementCreationFilter.AfterCreateChildElements(UIElement parent) { if (parent is CellUIElement) { UIElement cellButtonUIElement = parent.GetDescendant(typeof(CellButtonUIElement)); if (null != cellButtonUIElement) { Rectangle rect = parent.RectInsideBorders; rect.Inflate(-3, -3); cellButtonUIElement.Rect = rect; } } } bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent) { // do nothing return false; } }
Hi Mike,
The problem I'm trying to solve is to make button in column to not filling all the entire cell but at the same time all other column's content should fill all the cell.
Is it possible?
Hi Eugene,
I'm confused. I tried this out and I set CellPadding on the override to 5 in a grid with a button column. But the padding has no effect on the button column. The button still fills the entire cell.
So what's the problem you are trying to solve?
I'm setting style of a column to Button.