Hi,
I need to create some buttons in my Grid. Each button needs to display two lines of text... the top line needs to be displayed in Bold whereas the bottom line needs to be in a normal plain font. I'm thinking I'll need to create a new button control from scratch and embed it into the Grid. Could you suggest the best way to approach this problem. I like the look of the PopupSoftBorderless UltraButton, could I customise this in some way to use both font styles at once?
Many Thanks
Andy
Setting the column Style to Button and adding TextUIElements displays the text in the format I require, but it's led to a secondary problem. Normally if I hold down the mouse button anywhere in the button cell the button moves to a pressed state, but now it's got two child TextUIElements this doesn't seem to work properly. The rectangles containing the TextUIElements seem to prevent the mouse events reaching the underlying button, so the only way to get a pressed state is to click on the edge of the button (away from the Text). Is there an easy way to stop the TextUIElements consuming the mouse events? As I wish to use a Popup button style, the button cell needs to receive MouseUp, MouseDown, MouseMove etc so that the popup button is drawn correctly based on the position of the mouse.
Thanks
Hi Andy,
There's currently no way to embed an UltraButton in a grid cell. You could position the control over the cell, and I think there's a sample of this somewhere in the Infragistics Knowledge Base.
But I suspect you want the button to show up in more than one place, which means you would have to have a different button for every cell. I suspect that's not a feasible solution, because moving all those buttons around will almost certainly have performance implications for you app.
What I recommend is that you simply set the Style on the column(s) to Button. Then you use a CreationFilter to add a couple of TextUIElements to each button. You'll need to be able to pick up the text of the button from some value in the grid cell or row.