因看不懂,请教一段程序?
protected void gv_Privilege_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView drv = (DataRowView)e.Row.DataItem;
if (drv == null)
{
return;
}
for (int i = 0; i < drv.DataView.Table.Columns.Count; i++)
{
if (drv.DataView.Table.Columns[i].ColumnName != "资源名称 ")
{
//问题一?
CheckBox chk = (CheckBox)e.Row.Cells[i].Controls[0];
if (Convert.ToBoolean(drv[drv.DataView.Table.Columns[i].ColumnName].ToString()))
{
string roleId = lbl_GroupName.Attributes[ "RoleId "].ToString();
string privilegeId = new SMS_Privilege().GetPrivilegeId(drv[0].ToString(), drv.DataView.Table.Columns[i].ColumnName);