This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Is there a way to program a tooltip when the user hovers the mouse over a column header? I need a different tooltip per column, which will explain the definition of the column. Thanks, Nestor |
|
|
Hello Nestor To do this, I would recommend providing a custom column header template. This is a template applied to the text display within the column header. You can do this by setting the DataGrid.ColumnHeaderTemplate property. Below is an example of this:
This is very similar to the default header template which simply displays the header in a TextBlock. Around the text block I have placed a Border element which will be the host for the tool tip. This is so the tooltip can appear when the mouse is anywhere within the column header, rather than just over the text. Note it is important to set the Background of the Border to Transparent to enable hit testing. You can extend this template to provide a different tool tip for different columns by using template triggers or a converter on the ToolTip property. IMPORTANT: You'll need to get the next nightly build which will resolve some alignment issues in the header. Jason Fauchelle |
|
|
OK... that works for me. Thanks. |
|