Transfer happening too late to be useful

4 posts, 1 answers
  1. jrussel21
    jrussel21 avatar
    8 posts
    Member since:
    Mar 2010

    Posted 27 May 2010 Link to this post

    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> 
  2. jrussel21
    jrussel21 avatar
    8 posts
    Member since:
    Mar 2010

    Posted 27 May 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 28 May 2010 Link to this post

    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.
  5. jrussel21
    jrussel21 avatar
    8 posts
    Member since:
    Mar 2010

    Posted 28 May 2010 Link to this post

    Yes, I figured that, just pointing out that the need still exists for processing transfer/reodering data early in the pordcess.
Back to Top