如何在GridView中显示选定的值 [英] How to displaye selected value in a gridview

查看:101
本文介绍了如何在GridView中显示选定的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用从DropDownList中选择的字段填充Web应用程序中的GridView.
基本上,一旦从DropDownList中选择了一个项目,就会发生回发,并在GridView中填充包含该特定项目的字段.

Hi, I want to populate a GridView in a web application with a field selected from a DropDownList.
Basically, once you select an item is selected from a DropDownList, a postback happens and a GridView is populated with the field that contains that particular item.

推荐答案

在SelectedIndexChanged中下拉事件,您可以在网格上调用DataBind,这将导致它进行数据绑定.设置网格,以使参数之一是控制参数,并将其指向您的下拉菜单.
In the SelectedIndexChanged event for your drop down you can call DataBind on your grid which will cause it to databind. Setup your grid so that one of the parameters is a control parameter and point it to your dropdown.


这篇关于如何在GridView中显示选定的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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