Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
235
Load on Demand - Columns not set up
posted

Originally - UltraWebGrid v10.3
The grid's DataSource was set in a function that was called from Page_Load. The grid had no bands or columns set up. The InitializeLayout function would move and hide columns. The InitializeRow function would update a row with a link for the text.

Currently - WebDataGrid v14.2
I have changed the InitializeLayout to Init and left everything else the same. However, when I get into the Init function, it has yet to hit the Page_Load function and therefore errors out when trying to hide a column (as the DataSource has yet to be set or bound).

Having looked around, I found out that Init functions (everywhere) are called before the Page_Load function. Maybe the old InitializeRow and InitializeLayout weren't. Anyways, I then tried changing the Init function to the DataBound function, but now I'm having a different problem. Even though the grid is now bound and there are values in the DataSource, the columns remain 0.

Here is my markup:

    <igwdg:WebDataGrid ID="wdgOffice" runat="server" TabIndex="101" EnableViewState="false"></igwdg:WebDataGrid>

Here's where the DataSource is being set:

    wdgOffice.DataSource = OfficeTable 'dvOfficeList
    wdgOffice.DataMember = "Office"

    If (Not IsPostBack) Or (Not chkDeletedOffices.Checked) Then
        wdgOffice.DataBind()
    End If

As you can see by the attached picture, the DataSource is set, the grid says that it has columns, the grid says that it has 16 rows, yet it is throwing an error when trying to hide one of the columns. Am I missing something? I have a couple of other grids that act the same way, so this is quite important. Thanks.