在GridView_RowDataBound事件中绑定列

protected void DataGridView_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView row = (DataRowView)e.Row.DataItem; e.Row.Cells[0].Text = row["Field1"].ToString(); } }

你可能感兴趣的:(在GridView_RowDataBound事件中绑定列)