I need to add a tooltip for a column header of a DataGrid (Silverlight 4). I will generate the number of columns and column header text dynamically.
GridColumnCreation(....)
{
IEnumerable allHeaderText = /* Linq query */;
}
How to use this collection to set a tooltip?
This can be done by using DataGridTextColumn & DataGridTextColumn.HeaderStyle. In the headerstyle tag, use the ToolTipService and bind the content to the dynamic values generated. Here’s a sample code for this…
where Custdetails.. is something like this..
DataBinding…
This would display the header tooltips… To make it dynamic.. Replace the ToolTip Content with Binding & the desired value…