No Xfer when AutoPostBackOnTransfer = True

5 posts, 0 answers
  1. Mark Galbreath
    Mark Galbreath avatar
    171 posts
    Member since:
    Jul 2009

    Posted 18 Nov 2009 Link to this post

    RadListBox1 copies to RadListBox2 when AutoPostBackOnTransfer == false, but not if it is true - RadListBox2 remains blank.  The code-behind RadListBox1_Transferring() handler fires, but there are no items in the event args.  I need to intercept the value of the RadListBox1 item (a db table name) in order to populate RadListBox2 with the db table column names.

    Interestingly, when I programatically populate RadListBox2 and hit RadListBox1's << xfer back button, the item text is passed to the RadListBox1_Transferring() handler.

    Perhaps I am going about this a33-backwards, but I still don't get why copying (transfer) is not occuring when AutoPostBackOnTransfer is True.

    Conditions:
    RadAjaxManager1 EnableAjax = True
    RadListBox1.AutoPostBackOnTransferring = True
    RadListBox2.AutoPostBackOnTransferring = False
  2. Mark Galbreath
    Mark Galbreath avatar
    171 posts
    Member since:
    Jul 2009

    Posted 18 Nov 2009 Link to this post

    UPDATE

    Apparently, the failure to xfer/copy items from RadListBox1 to RadListBox2 is because RadListBox1 has an object datasource.  If I manually populate the listboxes, their items xfer back and forth fine.  What is going on here?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mark Galbreath
    Mark Galbreath avatar
    171 posts
    Member since:
    Jul 2009

    Posted 18 Nov 2009 Link to this post

    UPDATE

    Okay, although I've read numerous articles, including the Telerik user guide's, on page lifecycle, I don't understand this.  When I populate RadListBox1 through its datasource during its INIT phase, the controls xfer/copy as advertised, but fail when the control is bound during the LOAD phase.  Apparently, the Ajax Javascript for the controls is getting LOADed before the controls and the xfer/copy mechanism is blind to the control's items.

    Comments from Telerik?
  5. Simon
    Admin
    Simon avatar
    2281 posts

    Posted 20 Nov 2009 Link to this post

    Hi Mark Galbreath,

    This could happen if you are re-binding RadListBox1 on each postback in Page_Load as this clears the selection loaded from ViewState and the Transfer operation depends on the selection.

    So, one way to avoid this is to bind the RadListBox in the INIT phase or check for IsPostBack in the LOAD phase:

    if (!Page.IsPostBack)

    Greetings,
    Simon
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Mark Galbreath
    Mark Galbreath avatar
    171 posts
    Member since:
    Jul 2009

    Posted 20 Nov 2009 Link to this post

    Yep, figured that out, but thanks for playing!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017