通过下拉列表选择值显示gridview [英] display gridview based through dropdownlist selected value

查看:174
本文介绍了通过下拉列表选择值显示gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用asp.net 3.4版本vs2008在下拉列表im中基于所选值显示gridview.

i want to display gridview based on the selected value in drop down list im using asp.net 3.4 version vs2008

推荐答案

我只能给你这个主意,因为你尝试过.....

1)首先编写一个绑定gridview的函数,说BindData()

2)从if(!Page.IsPostBack)中的页面加载调用它.因此不会在每个回发事件上调用它.

3)从下拉列表的SelectedIndexChange事件中调用相同的函数.

4)将您的下拉列表的autopostback属性设置为true.因此它将回发到服务器.

如有任何疑问,请在评论中回复.... ::)
I can give you the Idea only, because you havnt tried for it.....

1) First of all write a function to bind gridview say BindData()

2) Call it from pageload in if(!Page.IsPostBack). So it will not get called on every postback event.

3) Call the same function from the Dropdownlist''s SelectedIndexChange Event.

4) Put your dropdownlist''s autopostback property to true. So it will postback to the server.

In case of any question, reply back in comment.......:)


检查相同类型的讨论
Check the same type of discussion here[^]


嗨.

第一的.您应该获取gridview的数据源.
第二.选择数据库,然后选择连接.
第三.您选择语句.
第四.您将在选择状态表中看到按钮"WHERE"
第五.您将在此处看到一个下拉列表.然后选择一个由下拉列表控制的列,然后将出现另一个下拉列表,选择"=".然后您将选择一个来源.选择. "control".那么您将看到"parameter properties"选择您的下拉列表ID.然后选择添加.


就是这样!

希望对您有帮助.
祝你好运. :)



-chaosgray-
hi.

first. you should get the data source of the gridview.
second. select database, then select connection.
third. you select statement.
fourth. you will see from the selecting statemet the button "WHERE"
fifth. you will see a dropdown there. then choose a column you are being control by your dropdown, then another dropdown will appear, select "=". then you will choose a source. select. "control". then you will see the "parameter properties" select you dropdown id. then select add.


and that''s it!.

hope it helps.
goodluck. :)



-chaosgray-


这篇关于通过下拉列表选择值显示gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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