private void FillGrid() { try { UserGridView.OptionsBehavior.Editable = true; DataSet ds = ProjectFunctions.GetDataSet("sp_LoadUserAllocatedWork '" + ProjectFunctions.SqlString(cmbSelectUser.Text) + "'"); ds.Tables[0].Merge(ds.Tables[1]); ds.Tables[0].Columns.Add("SPLRIGHTS", typeof(bool)); ds.Tables[0].Columns.Add("&Add", typeof(bool)); ds.Tables[0].Columns.Add("EDIT", typeof(bool)); ds.Tables[0].Columns.Add("DELETE", typeof(bool)); ds.Tables[0].Columns.Add("SELECTFIELD", typeof(bool)); ds.Tables[0].Columns.Add("MASTER", typeof(bool)); ds.Tables[0].Columns.Add("TRANSACTION", typeof(bool)); ds.Tables[0].Columns.Add("REPORT", typeof(bool)); ds.Tables[0].Columns.Add("ADMIN", typeof(bool)); foreach (DataRow dr in ds.Tables[0].Rows) { dr["SPLRIGHTS"] = false; dr["&Add"] = false; dr["EDIT"] = false; dr["DELETE"] = false; dr["SELECTFIELD"] = false; dr["MASTER"] = false; dr["TRANSACTION"] = false; dr["REPORT"] = false; dr["ADMIN"] = false; } for (var j = 0; j < ds.Tables[0].Rows.Count; j++) { if (ds.Tables[0].Rows[j]["ProgAdd_F"].ToString() == "-1") { ds.Tables[0].Rows[j]["&Add"] = true; } else { ds.Tables[0].Rows[j]["&Add"] = false; } if (ds.Tables[0].Rows[j]["ProgUpd_F"].ToString() == "-1") { ds.Tables[0].Rows[j]["EDIT"] = true; } else { ds.Tables[0].Rows[j]["EDIT"] = false; } if (ds.Tables[0].Rows[j]["ProgDel_F"].ToString() == "-1") { ds.Tables[0].Rows[j]["DELETE"] = true; } else { ds.Tables[0].Rows[j]["DELETE"] = false; } if (ds.Tables[0].Rows[j]["MasterMenu"].ToString() == "-1") { ds.Tables[0].Rows[j]["MASTER"] = true; } else { ds.Tables[0].Rows[j]["MASTER"] = false; } if (ds.Tables[0].Rows[j]["TransactionsMenu"].ToString() == "-1") { ds.Tables[0].Rows[j]["TRANSACTION"] = true; } else { ds.Tables[0].Rows[j]["TRANSACTION"] = false; } if (ds.Tables[0].Rows[j]["AdministratorMenu"].ToString() == "-1") { ds.Tables[0].Rows[j]["ADMIN"] = true; } else { ds.Tables[0].Rows[j]["ADMIN"] = false; } if (ds.Tables[0].Rows[j]["ReportMenu"].ToString() == "-1") { ds.Tables[0].Rows[j]["REPORT"] = true; } else { ds.Tables[0].Rows[j]["REPORT"] = false; } if (ds.Tables[0].Rows[j]["SelectField"].ToString() == "-1") { ds.Tables[0].Rows[j]["SELECTFIELD"] = true; } else { ds.Tables[0].Rows[j]["SELECTFIELD"] = false; } if (ds.Tables[0].Rows[j]["ProgSpl_U"].ToString() == "-1") { ds.Tables[0].Rows[j]["SPLRIGHTS"] = true; } else { ds.Tables[0].Rows[j]["SPLRIGHTS"] = false; } } ds.AcceptChanges(); WorkAllocationGrid.DataSource = ds.Tables[0]; UserGridView.BestFitColumns(); UserGridView.Columns[0].BestFit(); } catch (Exception ex) { ProjectFunctions.SpeakError(ex.Message); } }