protected void btnSend_Click(object sender, EventArgs e) { dt.Columns.Add("MenuName"); foreach (GridViewRow grdRow in grdMenuList.Rows) { if (((CheckBox)grdRow.FindControl("chkSelect")).Checked) { DataRow drow = dt.NewRow(); drow["MenuName"] = grdRow.Cells[1].Text; //drow["fname"] = grdRow.Cells[2].Text; //drow["lname"] = grdRow.Cells[3].Text; dt.Rows.Add(drow); } } if (dt.Rows.Count > 0) { grdMenuPermitted.DataSource = dt; grdMenuPermitted.DataBind(); } } protected void grdMenuPermitted_RowDataBound(object sender, GridViewRowEventArgs e) { }
protected void grdMenuPermitted_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView dr = (DataRowView)e.Row.DataItem; e.Row.Cells[0].Text = dr["MenuName"].ToString(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)