开发者

Listview Trouble - Tooltip Needed

开发者 https://www.devze.com 2023-01-25 07:54 出处:网络
I am building a WPF application in C# using VS2010 I have a listview that contains items from a database , and each item contains a field called (Name) and another field called (Time) .

I am building a WPF application in C# using VS2010

I have a listview that contains items from a database , and each item contains a field called (Name) and another field called (Time) .

Back in the database , each item has a third field called (Description) too ...

Now what I want is : When I choose an item from the list开发者_运维百科view , a tooltip is shown and it contains the data from the third field ..

How can I have various tooltips on one listview - one tooltip for each item - ?? How can I deal with my database ??

Thank You


Setting the Tooltip for a ListViewItem can be done like this

<ListView ...>
    <ListView.ItemContainerStyle>
        <Style TargetType="{x:Type ListViewItem}">
            <Setter Property="ToolTip" Value="{Binding Path=Name}"/>
        </Style>
    </ListView.ItemContainerStyle>
    <!-- ... -->
</ListView>
0

精彩评论

暂无评论...
验证码 换一张
取 消