在Xaml页面中将项目绑定到Combobox [英] binding items to Combobox in Xaml page

查看:154
本文介绍了在Xaml页面中将项目绑定到Combobox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Silverlight应用程序中绑定Xaml页面中的项目,如下面相同的clasic ASP。我们正在使用infragistics V11 XamComboEditor控件。请帮助我。



 <   asp:DropDownList     ID   =  DropDownListID    AppendDataBoundItems   =  true    runat   =  server >  
< asp:ListItem 文字 = 静态项目1 = 1 / >
< ; asp:ListItem 文字 = 静态项目2 < span class =code-attribute>值 = 2 / >
< asp:ListItem 文字 = 静态项目3 = 3 / >





问候

Srinivas

解决方案

< blockquote>试试这个。



 <   igEditors:XamComboEditor.ItemsProvider  >  
< igEditors:ComboBoxItemsProvider >
< igEditors:ComboBoxItemsProvider.Items >
< igEditors:ComboBoxDataI tem DisplayText = 项目1 = 第1项 / >
< igEditors:ComboBoxDataItem DisplayText = 第2项 = 第2项 < span class =code-keyword> / >
< igEditors:ComboBoxDataItem DisplayText = 第3项 = 第3项 / >
< / igEditors:ComboBoxItemsProvider.Items >
< / igEditors:ComboBoxItemsProvider >
< / igEditors:XamComboEditor.ItemsProvider >





了解更多信息

http://help.infragistics.com/Help/NetAdvantage/WPF/2011.1/CLR4.0/html/xamComboEditor_Manually_Add_Items_to_xamComboEditor.html [ ^ ]


How to bind items in Xaml page in silverlight application like as below same clasic ASP. We are using infragistics V11 XamComboEditor control. Please can help me on same.

<asp:DropDownList ID="DropDownListID" AppendDataBoundItems="true" runat="server">
     <asp:ListItem Text="static item 1" Value="1" />
     <asp:ListItem Text="static item 2" Value="2" />
     <asp:ListItem Text="static item 3" Value="3" />



Regards
Srinivas

解决方案

try as this.

<igEditors:XamComboEditor.ItemsProvider>
    <igEditors:ComboBoxItemsProvider>
        <igEditors:ComboBoxItemsProvider.Items>
            <igEditors:ComboBoxDataItem DisplayText="Item 1" Value="Item 1" />
            <igEditors:ComboBoxDataItem DisplayText="Item 2" Value="Item 2" />
            <igEditors:ComboBoxDataItem DisplayText="Item 3" Value="Item 3"/>
        </igEditors:ComboBoxItemsProvider.Items>
    </igEditors:ComboBoxItemsProvider>
</igEditors:XamComboEditor.ItemsProvider>



for more information
http://help.infragistics.com/Help/NetAdvantage/WPF/2011.1/CLR4.0/html/xamComboEditor_Manually_Add_Items_to_xamComboEditor.html[^]


这篇关于在Xaml页面中将项目绑定到Combobox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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