【发布时间】:2021-03-27 13:52:00
【问题描述】:
我想将我的 GridView 转换为以标题为第一行的列表。
这可以将我的 GridView 转换为没有标题的列表。
var Result = GridView.Rows.OfType<GridViewRow>().Select(
r => r.Cells.OfType<TableCell>().Select(c => c.Text).ToArray()).ToList();
我正在尝试将其与标题一起转换回来。
var myorgitem = GridView.Rows.OfType<GridViewRow>().Select(
r => r.Cells.OfType<TableCell>().ToDictionary(
c => ????????????????????, c => (c.Text ?? "").ToString())).ToList();
谢谢!
【问题讨论】:
标签: c# asp.net gridview aspxgridview