在 silverlight 中使用自动完成框?
我当前正在 Telerik 的 radgrid 控件中显示数据,我想在名为“Name”的列上添加一个自动文本框。我该怎么做?
我的 radgrid 仅显示数据,我希望每当用户输入文本框时都会弹出一个名称列表,就像在 stackoverflow 网站中一样。
请帮助..我一直在使用 silverlight、wcf ria 服务、telerik 控件。
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?
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.
please help..i have been using silverlight,wcf ria services,telerik controls.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Silverlight 4 Toolkit 中的自动完成文本框。该工具包是一组高级控件,不属于核心 Visual Studio 库的一部分。下载&安装后,您可以前往此处。安装完成后,添加对 System.Windows.Controls 的项目引用,并将其添加到 UserControl 声明中:
xmlns:input="clr-namespace:System.Windows.Controls; assembly=System.Windows.Controls。输入”
这为您提供了 Silverlight 工具包的参考点,特别是输入控件。完成后,以下是使用自动完成文本框的示例:
这直接来自 Silverlight Toolkit 的文档。 链接此处。单击左侧菜单中的“自动完成框”(标题下:“输入”)。加载后,您可以通过单击窗口底部的任意一项来查看 XAML/C#,例如“AutoCompleteBoxSample.xaml”或“AutoCompleteBoxSample.xaml.cs”,这将为您提供开始/代码。正在寻找。
在您的情况下,您还需要为 radgridview 创建一个单元格模板。以下是其外观的快速示例:
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:
xmlns:input="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input"
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:
<input:AutoCompleteBox IsTextCompletionEnabled="False" HorizontalAlignment="Left" ItemsSource="{StaticResource SampleEmployees}" SelectionChanged="OnSelectionChanged"/>
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.
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: