62,046
社区成员
发帖
与我相关
我的任务
分享
<asp:GridView ID="gvSiteList" runat="server" AutoGenerateColumns="true"
AllowPaging="false" Height="390px" Width="100%"
CssClass="gridViews" HeaderStyle-CssClass ="gridViewContent">
DataTable SiteDB = CreateSiteDataTable();
foreach (GridViewRow row in gvSiteList.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
if (row.Cells[0].Text.ToString() != e.CommandArgument.ToString())
{
DataRow dataRow = SiteDB.NewRow();
// dataRow["RowID"] = row.Cells[0].Text;
dataRow["ID"] = row.Cells[0].Text;
dataRow["Name"] = row.Cells[1].Text;
dataRow["State"] = row.Cells[2].Text;
dataRow["Region"] = row.Cells[3].Text;
dataRow["Group"] = row.Cells[4].Text;
SiteDB.Rows.Add(dataRow);
}
}
}
gvSiteList.DataSource = SiteDB;
gvSiteList.DataBind();