使用Silverlight中自动完成框? [英] using autocomplete box in silverlight?

查看:138
本文介绍了使用Silverlight中自动完成框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在显示Telerik的的radgrid控件控制的数据,我想通过一个名为姓名一栏添加一个autotextbox。我怎样才能做到这一点?

i am currently displaying data in the radgrid controls of telerik, i want to add an autotextbox over the column named "Name". how can i do this?

我radgrid控件只显示数据,我想,只要用户进入文本名称的列表弹出就像在计算器网站。

my radgrid only displays data and i want that whenever user enters into textbox a list of name pops up just like in stackoverflow web site.

请help..i已经使用Silverlight,WCF RIA服务,Telerik控制。

please help..i have been using silverlight,wcf ria services,telerik controls.

推荐答案

您可以从Silverlight 4的工具包使用自动完成文本框。该工具包是一套先进的不属于核心的Visual Studio库的一部分控制。要下载和放大器;安装,您可以前往这里。一旦你安装了它,您添加的项目引用System.Windows.Controls的添加到您的用户控件声明:

You can use the AutoComplete textbox from the Silverlight 4 Toolkit. The toolkit is an advanced set of controls that are not part of the core Visual Studio library. To download & install, you can head here. Once you have it installed, you add a project reference to System.Windows.Controls add this to your UserControl declaration:

<$c$c>xmlns:input=\"clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input\"

这为您提供了Silverlight工具包,特别是输入控件的参考点。一旦这样做了,这里是使用自动完成文本框的例子:

This gives you a reference point for the Silverlight Toolkit, specifically the input controls. Once that's done, here is an example of using the autocomplete textbox:

&LT;输入:AutoCompleteBox IsTextCompletionEnabled =FALSE的Horizo​​ntalAlignment =左的ItemsSource ={StaticResource的SampleEmployees}的SelectionChanged =OnSelectionChanged/&GT;

此直接从Silverlight工具包的文档来。 链接这里。点击左侧菜单中的AutoCompleteBox(标题下:输入)。装一次,您可以通过点击AutoCompleteBoxSample.xaml.cs这应该给你开始/ $ C $在窗口底部的项目,如AutoCompleteBoxSample.xaml'或任何一个浏览XAML / C# c您要寻找的。

This comes directly from the documentation from the Silverlight Toolkit. Link here. Click the 'AutoCompleteBox' in the left menu (under heading: Input). Once loaded, you can view the XAML/C# by clicking on any one of the items at the bottom of the window, such as 'AutoCompleteBoxSample.xaml' or 'AutoCompleteBoxSample.xaml.cs' This should give you the start/code you're looking for.

在你的情况,你还需要创建用于radgridview单元模板。下面是什么可能看起来像一个快速的例子:

In your case, you'll also need to create a cell template for the radgridview. Here's a quick sample of what that might look like:

<radControls:RadGridView x:Name="registerGridView" 
                             AutoGenerateColumns="False">  
        <radControls:RadGridView.Columns> 
            <radControls:GridViewToggleRowDetailsColumn /> 
            <radControls:GridViewDataColumn Header="Client" /> 
            <radControls:GridViewDataColumn Header="Site" />  
            <radControls:GridViewDataColumn Header="Name">  
                <radControls:GridViewDataColumn.CellTemplate> 
                    <DataTemplate> 
                        <StackPanel Orientation="Horizontal">  
                            <input:AutoCompleteBox HorizontalAlignment="Left" ItemsSource="{Binding Names}" SelectionChanged="OnSelectionChanged"/>
                        </StackPanel> 
                    </DataTemplate> 
                </radControls:GridViewDataColumn.CellTemplate> 
            </radControls:GridViewDataColumn> 
        </radControls:RadGridView.Columns> 
    </radControls:RadGridView> 

这篇关于使用Silverlight中自动完成框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆