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
60
ultrawebgrid, Custom UserControl, UpdatePanel, LoadControl and Paging in an UserControl
posted

Hello all,

i've got following constellation:

one default.aspx with two updatepanels (left, right of the form). on the left updatePanel, i've put the ultraweblistbar control. on the other updatepanel (right) i dynamically load the content in the item_clicked-event of the weblistbar via

control = LoadControl(...) and

updatepanelright.ContentTemplateContainer.Controls.Add(control)

updatepanelright.Update();

The loaded user control contains a sqldatasource and a ultrawebgrid.

The paging in the grid is activated and the event grid_pageIndexChanged is programmed as described in Infragistics help.

When starting the application and clicking on the weblistbar item, the grid is loaded and shown well, but when clicking on a pager link, nothing happens. Clicking a second time on the same pager link, the control disappears. I've noticed that even the grid_pageIndexChanged event is not fired. However, loading the user control into a placeholder control and not a updatePanel works fine with paging.

 Any Ideas ?

 

Parents
No Data
Reply
  • 28464
    posted

    Hello,

    Yes, testing with WARP would be a good idea and could lead to better results. I just want to add the this could very well be a page-lifecycle issue.  Controls added programmatically with code to template containers that need to fire events, must be added no later the OnInit I think so the listbar click event (fires after load) could be too late. It is a tricky topic that is very well described in the following blog post:

    http://msmvps.com/blogs/luisabreu/archive/2007/02/15/adding-controls-to-an-updatepanel-through-code.aspx

    With a lot of demo code and special comments on how to deal with postbacks and events. Highly recommended - can help a lot.

    HTH,

Children
No Data