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

Transfer happening too late to be useful

3 Answers 68 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
jrussel21
Top achievements
Rank 1
jrussel21 asked on 27 May 2010, 06:56 PM
I have a pair of RadListBoxes that work together as documented.

I use the contents of the RadListBox2 as the names for some tabs in a RadTabStrip that I configure/use elsewhere in the page. The RadTabStrip is defined during Page_Load. Currently when I look at the RadListBox2.Items, I only see the items that were there before the post-back and none of the newly transferred items, so my RadTabStrip does not contain the newly added items (if I do another post-back, the new items show up because the transfer event fires successfully after the Page_Load).

I suppose I could wait to create the tabs until the OnTransferred event fires, but that requires some code restructuring and seems a bit backwards to me in the page life cycle. Seems like the transfer should be happening during page load.

Does anyone have any suggestions on how to achieve my goals in Page_Load or Page_Init rather than in OnTransferred?

Here is how I have the controls configured:
                <telerik:RadListBox ID="RadListBox1" 
                                    runat="server" 
                                    Height="190px" 
                                    Width="230px" 
                                    AllowTransfer="true" 
                                    TransferToID="RadListBox2" 
                                    TransferMode="Move" 
                                    AutoPostBackOnTransfer="true" 
                                    AllowTransferDuplicates="false" 
                                    AllowTransferOnDoubleClick="true" 
                                    EnableDragAndDrop="false">  
                </telerik:RadListBox> 
                <telerik:RadListBox ID="RadListBox2" 
                                    runat="server" 
                                    Height="190px" 
                                    Width="200px" 
                                    AutoPostBackOnReorder="true" 
                                    AllowReorder="true" 
                                    ButtonSettings-ShowReorder="true" 
                                    ButtonSettings-ReorderButtons="Common">  
                </telerik:RadListBox> 

3 Answers, 1 is accepted

Sort by
0
jrussel21
Top achievements
Rank 1
answered on 27 May 2010, 09:09 PM
So I have solved my issue by pre-creating all of the tabs and then making only some of them visible based upon the content in RadListBox2. In the OnTransferred event, I loop through the contents and then update the RadTab.Visible property accordingly. Turned out the code to do this was trivial, but it still seems to me that the "transfer" processing should happen earlier in the page life cycle.

Now on to the RadControl that has column visibility to deal with as well.

The one side benefit to the pre-creation is that I do not need to do a postback to bring the hidden tabs/columns into view. I will be able to write some client code that just changes the attribute visible attribute of the columns and tabs.
0
Accepted
Genady Sergeev
Telerik team
answered on 28 May 2010, 04:16 PM
Hello jrussel21,

We can't fire the OnTransferred event before the page executes its OnLoad event. The reason for this, is that we use the RaisePostBackEvent to determine whether to fire OnTransferred or not.  As you can see from this article, the RaisePostBackEvent is fired after load. More information on the ASP.NET Page life cycle can be found here.

Sincerely yours,
Genady Sergeev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
jrussel21
Top achievements
Rank 1
answered on 28 May 2010, 07:16 PM
Yes, I figured that, just pointing out that the need still exists for processing transfer/reodering data early in the pordcess.
Tags
ListBox
Asked by
jrussel21
Top achievements
Rank 1
Answers by
jrussel21
Top achievements
Rank 1
Genady Sergeev
Telerik team
Share this question
or