WPF界面中控件及其属性用法(五)【AutoCompleteBox】

效果图:

 <TextBlock Grid.Column="0" Grid.Row=" 0" Style="{StaticResource TextBlockStretchStyle}">

             <Run Foreground="Red">*</Run>

            <Run>对应参与人员:</Run>

 </TextBlock>

<telerik:RadAutoCompleteBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3"

                            WatermarkContent="请输入姓名或姓名拼音首字母"

                            TextSearchMode="Contains"

                            AutoCompleteMode="Suggest"

                            TextSearchPath="NameAndNameSpell"

                            DisplayMemberPath="Name"

                            HorizontalAlignment="Left"

                            ToolTipService.ToolTip="请输入姓名或姓名拼音首字母"

                            SelectionMode="Multiple"

                            IsDropDownOpen="True"

                            SelectedItems="{Binding SelectedMemberVOs,Mode=TwoWay}"

                            Beh:FocusExtension.IsFocused="{Binding MembersFocus}"  

                            BorderBrush="{Binding MembersBrush}"

         Style="{StaticResource ResourceKey=RadAutoCompleteBoxStyle}" Width="330"

ItemsSource="{Binding Path=Members,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}

DropDownItemTemplate="{StaticResource ResourceKey=NameSearchAutoCompleteDropDownItem}"

                          >

     <EventsBinding:EventBinder.Mappings>

        <EventsBinding:CommandEvent Event="LostFocus" Command="{Binding  LegMemberLostFocus}" />

     </EventsBinding:EventBinder.Mappings>

</telerik:RadAutoCompleteBox>

对用到的属性进行解释:

1.WatermarkContent  该属性主要用于在该控件中显示信息。

2. TextSearchMode    文本搜索模式。设为“Contains”表示包含该文本的都显示出来。

效果图:(当输入1时,所有有1的文本都在下拉框中显示出来)

3.AutoCompleteMode 自动补全模式.

4.TextSearchPath  文本搜索路径。即用到的数据信息。

5.DisplayMemberPath  在用到的数据信息中在该框的下拉框中用于显示的信息。

6.ToolTipService.ToolTip  鼠标移动到该控件上显示的信息。

7.SelectionMode       选择模式(包含单选、多选)

8.IsDropDownOpen     用于是否打开下拉菜单,用于匹配。

9.SelectedItems      绑定选中的信息。

10.ItemSource         绑定用到的所有信息。即绑定信息来源。

11.BehFocusExtension.IsFocused    绑定控件聚焦时触发事件。

12.BorderBrush        绑定控件的边框颜色。

转载于:https://www.cnblogs.com/Latent-Truth/archive/2013/05/14/3077769.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值