public void Matrix() { try { dt = new DataTable(); dt = getLevel.Copy(); for (int j = 0; j < getmenu.Rows.Count; j++) { dt.Columns.Add(new DataColumn(getmenu.Rows[j][1].ToString(), typeof(bool))); } GridMatrix.DataSource = dt; GridMatrix.DataBind(); //For Hiding Profile Level Value From Grid GridMatrix.HeaderRow.Cells[1].Visible = false; foreach (GridViewRow gvr in GridMatrix.Rows) { gvr.Cells[1].Visible = false; } } catch (Exception ex) { lblmsg.Text = ex.Message; } }
public void Matrix() { try { dt = new DataTable(); dt = getLevel.Copy(); for (int j = 0; j < getmenu.Rows.Count; j++) { dt.Columns.Add(new DataColumn(getmenu.Rows[j][1].ToString(), typeof(bool))); } //dt.Columns["DEGREE CERTIFICATE"].ColumnName = "DEGREE"; //dt.Columns["PROVISIONAL DEGREE CERTIFICATE"].ColumnName = "PROVISIONAL DEGREE"; //dt.Columns["PASSING CERTIFICATE"].ColumnName = "PASSING"; //dt.Columns["MERIT CERTIFICATE"].ColumnName = "MERIT"; //dt.Columns["ATTEMPT CERTIFICATE"].ColumnName = "ATTEMPT"; //dt.Columns["MEDAL CERTIFICATE"].ColumnName = "MEDAL"; //dt.Columns["DUPLICATE MARKSHEET"].ColumnName = "DUPLICATE"; //dt.Columns["MARKSHEET VERIFICATION CERTIFICATE / LETTER"].ColumnName = "MARKSHEET VERIFICATION"; //dt.Columns["DEGREE VERIFICATION CERTIFICATE / LETTER"].ColumnName = "DEGREE VERIFICATION"; //dt.Columns["DATE OF DECLARATION CERTIFICATE / LETTER"].ColumnName = "DATE OF DECLARATION "; //dt.Columns["MEDIUM OF INSTRUCTION CERTIFICATE / LETTER"].ColumnName = "MEDIUM OF INSTRUCTION"; GridMatrix.DataSource = dt; GridMatrix.DataBind(); //For Hiding Profile Level Value From Grid GridMatrix.HeaderRow.Cells[1].Visible = false; foreach (GridViewRow gvr in GridMatrix.Rows) { gvr.Cells[1].Visible = false; gvr.Cells[2].Width = 150; } } catch (Exception ex) { lblmsg.Text = ex.Message; } }
protected void GridMatrix_DataBind() { GridMatrix.DataBind(); }