带有Gridview的组合框 [英] Combobox with Gridview

查看:97
本文介绍了带有Gridview的组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


选择组合框时,出现了一个组合框,网格"视图显示所选项目的记录.
我的组合框被竞标到数据库中,从而成为我的网格视图.现在我想在组合框上具有全部"选项,它将在同一组合框中显示数据库中的每条记录,而我有那些显示与以下内容链接的记录的选项 1.可以这样做吗?
2.如果是,我必须如何在组合框上添加全部"选项.

Hi
I got a combobox when I select it, the Grid view display the records of the selected item.
My combobox is bided to the database so as my gridview. now I want to have "All" option on combobox that will display every records in database in the same combobox that I have those option that display records that link with
1. is it possible to do that?
2.if yes, how must I add the"All"option on combobox

推荐答案

如果您将属性"AppendDataBoundItems"设置为true,则可以指定ListItem在aspx页面中.从数据库中获取的ListItem将在下面添加.这样,您可以添加数据库中不存在的值.

if you use the property "AppendDataBoundItems" set to true, you can specify the ListItem in the aspx page. The ListItem taken from the database, will be added below. In this way you can add values ​​that are not present in the database.

<asp:dropdownlist appenddatabounditems="true" ...="" xmlns:asp="#unknown">
    <asp:listitem text="All" value="" />
</asp:dropdownlist>


这篇关于带有Gridview的组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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