Im having some trouble understanding why I cant access columns within the PreRender function. Here is the code. I am loading the grid at runtime.
Why do I not get inside of either of these loops? But, the commented code will set the ID columns visibility to false if uncommented.
Here is the PageLoad just in case.
Why do I not get inside of either of these loops? But, the commented code will set the ID columns visibility to false if uncommented.
Private Sub RadGrid_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid.PreRender For Each column As GridColumn In RadGrid.MasterTableView.Columns If column.UniqueName = "ID" Then column.Visible = False 'Not column.Visible End If Next For Each column2 As GridColumn In RadGrid.Columns If column2.UniqueName = "ID" Then column2.Visible = False 'Not column.Visible End If Next 'Dim column3 As GridColumn = RadGrid.MasterTableView.GetColumnSafe("ID") 'If column3 IsNot Nothing Then ' column3.Visible = False 'Not column.Visible 'End If RadGrid.MasterTableView.Rebind() End SubHere is the PageLoad just in case.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostBack() Then Dim bp As BasePage bp = CType(Parent.Page, BasePage) RadGrid.DataSource = bp.mDs bp.ExecuteQuery(" WHERE 1 = 0 ") End IfEnd Sub