This is a migrated thread and some comments may be shown as answers.

No Xfer when AutoPostBackOnTransfer = True

4 Answers 34 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Mark Galbreath
Top achievements
Rank 2
Mark Galbreath asked on 18 Nov 2009, 02:09 PM
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

4 Answers, 1 is accepted

Sort by
0
Mark Galbreath
Top achievements
Rank 2
answered on 18 Nov 2009, 03:41 PM
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?
0
Mark Galbreath
Top achievements
Rank 2
answered on 18 Nov 2009, 03:52 PM
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?
0
Simon
Telerik team
answered on 20 Nov 2009, 02:13 PM
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.
0
Mark Galbreath
Top achievements
Rank 2
answered on 20 Nov 2009, 02:27 PM
Yep, figured that out, but thanks for playing!
Tags
ListBox
Asked by
Mark Galbreath
Top achievements
Rank 2
Answers by
Mark Galbreath
Top achievements
Rank 2
Simon
Telerik team
Share this question
or