Hi,
I have a button column in the ultrawingrid. I added the column button using the column style property.
Column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle
It is the last column in my grid.
Each cell in the grid is having a lot of data. So the row height is larger. That is fine. But the button is also occupying the complete cell. Button height and width is also too larger. But I want to reduce the button height and width.
Can you please let me know, How can I specify the button width and height in the cell?
Thanks,
Venkat.
I could be mistaken but I don't think you can change the size of the buttons, i.e., it is always sized to occupy the whole cell. I would imagine you could change it using the IUIElementCreationFilter interface, however. This is a simple interface that give you a chance to change the UIElements that we add to the control.
I was thinking the same thing. The only way I can think of that allows you to change the size of those buttons is through a CreationFilter.
Something like this should be what you are after:
class ButtonSizeFilter : IUIElementCreationFilter { public void AfterCreateChildElements(UIElement parent) { }
public bool BeforeCreateChildElements(UIElement parent) { if (parent is CellButtonUIElement) { System.Drawing.Rectangle rect = parent.Rect;
((CellButtonUIElement)parent).Rect = new System.Drawing.Rectangle(rect.X, rect.Y, 30, 30); } return false; } }
You will have to find the size (replace 30,30) and the location within the CellUIElement (replace rect.X,rect.Y) with a calcuation for where you want them to locate. This should get you started though.
Yes. I tried it. It is working.
Thanks for the reply.