除第一项外,如何在组合框中的每个项目上设置工具提示 [英] How to set tooltips on each items in a combobox except first item
问题描述
我正在使用telerik wpf控件
这里是来自wpf xaml文件的代码片段请看看。
我正在使用绑定来填充组合框。 />
i想要在comboox中的每个项目上设置tootips,除了第一项
myt itemd是静态的,那里只有4个项目
item1选择
item2和解
item2评论
item2历史
< ComboBox
x:Name =cmbBankReconciliationFunction
IsEditable =True
IsReadOnly = True
ItemsSource ={Binding BanckReconciliationFunctions}
SelectedValue ={Binding SelectedFunction,Mode = TwoWay,
UpdateSourceTrigger = PropertyChanged}
VerticalAlignment =中心
IsRequired =True
Margin =17,0,0,0>
是否有可能在文件后面的代码中捕获一些事件并且可以达到预期的结果?
任何帮助都会有很大的帮助
谢谢
我的尝试:
我所尝试的是在wpf xaml代码中使用用于组合框的项目板和资源但是无法获得结果。
i am using telerik wpf controls
here is my code snippet from wpf xaml file please have a look.
I am using using binding to populate combobox.
i want to set tootips on each items in a comboox except first item
myt itemd are static there will be only 4 items there
item1 "Select"
item2 "Reconciliation"
item2 "Review"
item2 "History"
<ComboBox
x:Name="cmbBankReconciliationFunction"
IsEditable="True"
IsReadOnly="True"
ItemsSource="{Binding BanckReconciliationFunctions}"
SelectedValue="{Binding SelectedFunction, Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
IsRequired="True"
Margin="17,0,0,0">
is it possible to capture some event in code behind file and can e achieve the expected results ?
any help would be much appretiated
Thanks
What I have tried:
what i have tried is to use the itemteplate and resource for combobox in a wpf xaml code but not be able to get the results.
推荐答案
Telerik控件是自定义控件。 Telerik有自己的控件论坛。以下是WPF控件的论坛: WPF论坛用户界面 - Telerik社区 [ ^ ]
抓住它,使用数据绑定,您可以手动设置ItemTemplate
和SelectionBoxTemplate
并在其中设置工具提示。以下是Telerik文档中的参考,作为处理这些内容的起点:创建ItemTemplate和SelectionBoxTemplate | WPF文档按进度的UI [ ^ ]
然后你可以使用TemplateSelector
来实现你的设计目标。 Telerik有一个示例说明如何针对不同的要求执行此操作,但同样的原则适用:启用\Disable RadComboBoxItems |按进度划分的WPF文档UI [ ^ ]
Telerik controls are custom controls. Telerik has their own forums for their controls. Here are the forums for the WPF controls: UI for WPF Forums - Telerik Community[^]
Taking a stab at it, using data binding, you can manually set theItemTemplate
andSelectionBoxTemplate
and set the tooltip in there. Here is a reference in the Telerik documentation as a starting point for working with these: Creating ItemTemplate and SelectionBoxTemplate | UI for WPF Documentation by Progress[^]
Then you could use aTemplateSelector
for achieving your design goals. Telerik has an example of how to do this for a different requirement however the same principle applies: Enable\Disable RadComboBoxItems | UI for WPF Documentation by Progress[^]
这篇关于除第一项外,如何在组合框中的每个项目上设置工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!