tags:

views:

524

answers:

2

Hi all, I'm using WPFtoolkit Datagridd ,I have to wrap text in a datagridtextcolumn or I have to add a tool tip to the text column .I have searched the net but i coulddn't get a proper solution.Expecting your's valuable suggestions...

A: 

I'm not sure you can add a tooltip to a DataGridTextColumn but you can easily use the DataGridTemplateColumn and the ToolTipService instead. e.g.

            <data:DataGrid.Columns>
            <data:DataGridTemplateColumn Header="Broker">
                <data:DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Moniker.Abbreviation}" ToolTipService.ToolTip="{Binding Moniker.Name}" />
                    </DataTemplate>
                </data:DataGridTemplateColumn.CellTemplate>
            </data:DataGridTemplateColumn>
            </data:DataGrid.Columns>

In this example Moniker.Abbreviation is displayed in the column. When the user hovers over a cell, the full broker name (Moniker.Name) is displayed in the tooltip.

Note: This example was taken from a Silverlight 3.0 application.

Mark Gladding
A: 

@MARK , I did try your suggestion but it did not work,I have the columns added at runtime and written the XAML as you have suggested but it did not work,any help!

dragonball