Hi,
I just want to know if there's any way to put some sort of comment in the header of an UltraGridColumn just like you can do in Microsoft Excel.
Thanks for your replies.
Can you explain in more detail exactly what you mean. I'm not familiar with Excel's ability to comment headers.
Hi, Mike.
I've got to tell you I'm asking this in behalf of a co-worker and my initial post was all the info. I got from him, I asked him for more details and he told me Excel has some functionality that allows the colum headers to display some sort of comment like a tooltip, so that when you hover a special red sign in the header, you get some text displayed; this is what he's trying to achieve using the ultragrid.
Regards.
You can add an image into a cell using the Appearance. That part is simple enough.
Then all you have to do is determine when the mouse is over that image and show your tooltip. You would do this using the grid's UIElement structure. In this case, you would use the MouseMove event of the grid and call grid.DisplayLayout.UIElement.LastElementEntered.
If the element is not null, you could check to see if it's an ImageUIElement. You would then probably use GetContext on the element to get the UltraGridCell. From there you could get the column and/or the row and decide whether to show a tooltip and what it's text should be.
Mike. i'm looking for something similar but I'm looking for a way to indicate in a ultragrid cell that there is a tooltip associated with a cell. In me requirement, the user needs a visual indicator in the cell, like an image or a little red triangle at the top of the cell that the user can mouse over and get the tooltip. Have any ideas on how I could accomplish that?
Thanks, Mike.
I gave your answer to my colleague and I guess hes going for the tooltip solution. I there there is a tooltip property on the header, so it should be easy.
Thanks again.
Well, that's not a lot to go on. There are no comments built into the headers in the grid, but I you can certainly show a tooltip. I'm not sure if there is a ToolTip property on the column.Header itself. If there is, you can use it, otherwise, you could detect the position of the mouse and set a tooltip on the grid when the mouse is over a header.
If you really wanted to work at it and show somre sort of indicator in the header, you could use a CreationFilter to do that. But it's hard to say more without knowing exactly what the requirement is. :)