WPF ComboBox绑定集合,并根据集合中每个元素的特征决定是否禁止该项 本帖最后由 gqqnb 于 2011-12-25 14:27:26 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 学习来了http://kb.cnblogs.com/a/1428743/ 这时使用触发器的好场景。用触发器将ComboBoxItem.IsEnabled绑定到IpInfo.Enabled。<ComboBox ItemTemplate="{StaticResource IpInfoTemplate}" ItemsSource="{Binding Source={x:Static WpfApplication1:App.IpInfoList}, Mode=OneWay}"> <ComboBox.ItemContainerStyle> <Style TargetType="{x:Type ComboBoxItem}"> <Setter Property="IsEnabled" Value="{Binding Enabled}"/> </Style> </ComboBox.ItemContainerStyle></ComboBox> richtextbox自动滚屏的速度问题 点 在一个面内 调用外部程序问题求助 又是.NET的。.. windows服务已经启动了,为什么不运行? 求高手 C++转C# 急! 在线等 DataGridBoolColumn的問題. 怎样自动生成网络拓扑图啊? 为什么using语句内的变量不能修改? 高手请教!数据库问题!(在线等待) 请问这两种写法那个是对的? 问一个串口通讯问题
<ComboBox ItemTemplate="{StaticResource IpInfoTemplate}"
ItemsSource="{Binding Source={x:Static WpfApplication1:App.IpInfoList}, Mode=OneWay}">
<ComboBox.ItemContainerStyle>
<Style TargetType="{x:Type ComboBoxItem}">
<Setter Property="IsEnabled" Value="{Binding Enabled}"/>
</Style>
</ComboBox.ItemContainerStyle>
</ComboBox>