【发布时间】:2018-02-23 16:56:02
【问题描述】:
我创建了一个网页来显示本地数据库中存储的数据。我想使用 DropDownList Item 来更改 GridView 中的列和顺序。从下拉列表中选择或更改查询字符串时更改 DataGrid 数据源会更容易吗?
所有数据都是从同一个数据源中提取的,但是显示不同的列和不同的顺序。
例如:
DropdownList Selctions 是(General Overview、portfolio、System Log)
选择一般概览后: GridView 将显示 Columns([name],[Location],[Profit],[Currentstandings] Ordered by Name asending From Tabel[Main])
在选择投资组合时:
GridView 会显示
Column([name],[Current Standings],[profit],[Price],[Quantity Bought],[Buy/Sell] 按从 Table[main] 降序的利润排序)
选择系统日志时:
gridview 会显示
Column([Time],[System Message],[Error Code], [Restart] 按时间排序,从表[System Log]开始)
任何帮助将不胜感激!我已经搜索了两天没有结果的答案。欢迎提出想法!!谢谢!
【问题讨论】:
标签: c# asp.net gridview drop-down-menu webforms