I am programmatically adding columns to the RadGrid.
The problem is, after a postback (when say expanding the grid even though there is no code to populate data for the next level down hierarchy), the heading columns are gone.
any ideas why?
I also need to state that, should there be a postback from a column, which will be added in the future, that I need to obtain the modified row column values also.
The problem is, after a postback (when say expanding the grid even though there is no code to populate data for the next level down hierarchy), the heading columns are gone.
any ideas why?
I also need to state that, should there be a postback from a column, which will be added in the future, that I need to obtain the modified row column values also.
protected void Page_Load(object sender, EventArgs e)
{
this.DoSetDefaultMenuColumns();
}
private void DoSetDefaultMenuColumns()
{
// lets create the columns.
GridBoundColumn menuIDColumn = new GridBoundColumn();
menuIDColumn.HeaderText = "Menu ID";
menuIDColumn.DataField = "MenuID";
GridBoundColumn menuNameColumn = new GridBoundColumn();
menuNameColumn.HeaderText = "Menu Name";
menuNameColumn.DataField = "MenuName";
GridDropDownColumn menuOrderColumn = new GridDropDownColumn();
menuOrderColumn.HeaderText = "Menu Order ID";
menuOrderColumn.DataField = "MenuOrderID";
GridDropDownColumn parentIDColumn = new GridDropDownColumn();
parentIDColumn.HeaderText = "Parent ID";
parentIDColumn.DataField = "ParentID";
GridCheckBoxColumn isAdminColumn = new GridCheckBoxColumn();
isAdminColumn.HeaderText = "Is Admin";
isAdminColumn.DataField = "IsAdmin";
GridBoundColumn pageURLColumn = new GridBoundColumn();
pageURLColumn.HeaderText = "Page URL";
pageURLColumn.DataField = "PageURL";
GridCheckBoxColumn employeeAccessColumn = new GridCheckBoxColumn();
employeeAccessColumn.HeaderText = "Employee Access";
employeeAccessColumn.DataField = "EmployeeAccess";
GridCheckBoxColumn customerAccessColumn = new GridCheckBoxColumn();
customerAccessColumn.HeaderText = "Customer Access";
customerAccessColumn.DataField = "CustomerAccess";
this.radGridMenus.MasterTableView.Columns.Add(menuIDColumn);
this.radGridMenus.MasterTableView.Columns.Add(menuNameColumn);
this.radGridMenus.MasterTableView.Columns.Add(menuOrderColumn);
this.radGridMenus.MasterTableView.Columns.Add(parentIDColumn);
this.radGridMenus.MasterTableView.Columns.Add(pageURLColumn);
this.radGridMenus.MasterTableView.Columns.Add(isAdminColumn);
this.radGridMenus.MasterTableView.Columns.Add(employeeAccessColumn);
this.radGridMenus.MasterTableView.Columns.Add(customerAccessColumn);
}