Ticket T939586
Visible to All Users

GridView for WebForms - How to prevent GridView from DataBinding before a BootstrapPopupControl is shown

created 5 years ago

Dear support,

We have multiple BootstrapPopupControl instances that are each attached to a BootstrapButtonEdit. Inside each BootstrapPopupControl, we've placed a ASPxGridView, which is bound to an ObjectDataSource using custom data binding. We were expecting the data binding not to be run until the popup content is visible, but apparently, it is run before that, so that the initial page load is delayed quite a bit (since it needs to wait for all SQL requests and data binding to happen).

I've attached a small repro for this issue. You'll find that the Default.aspx page loads much more slowly than the Fast.aspx, because the simulated database query is run during the first load, even though the popup is not visible, and the popup is set to LoadContentViaCallback="OnFirstShow". In our view, it does not make a lot of sense to perform costly data binding if it's not obvious that the grid will be displayed.

Can you please advise us on how to correctly avoid data binding until the popup is shown by the user?

Thank you!

Best,
Johannes

Answers

created 5 years ago

Hi Johannes,

Thank you for providing us a sample project. The LoadContentViaCallback property specifies when the content will be rendered on the client side however the standard ASP.net ignores this property and builds a hierarchy on the server. This causes the binding to be performed even before the BootstrapPopupControl control is visible. Please see LoadContentViaCallback isn't working as expected. Just like Artemy's suggestion on the other ticket, adding ASPxGridView to the hierarchy on runtime will prevent the issue. You can also check the sample project he provided on the ticket.

Please let us know if this helps

Regards,
Neil

    Comments (2)
    JA JA
    Johannes Athmer 5 years ago

      Hi Neil,

      Thanks for the swift response and your suggestion! I've tried the proposed solution and ran into some issues with filtering and sorting for the dynamically loaded controls - likely because of ViewState usage. Instead of that, I've decided to simply set the IsVisible property of the gridView based on the popup state and the state saved in the ASP.NET session. Using popupControl.IsCallback was the most important hint in the linked solution.

      Best,
      Johannes

      DevExpress Support Team 5 years ago

        Thank you for sharing your solution with us. Please let us know if you need additional assistance

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.