RadListBox Events

3 posts, 0 answers
  1. Ali Kitabi
    Ali Kitabi avatar
    8 posts
    Member since:
    Nov 2008

    Posted 11 May 2010 Link to this post

    Hi,

    I am trying to register events on the RadListBox but whatever I do the event never fires for OnInserted, OnInserting, OnTransferred and OnTransferring. The only event that does get fired is the OnDeleted event. I have tried to register events in the markup and in code-behind to vain.

    Please help me out with this.

    Regards,

    Ali
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 12 May 2010 Link to this post

    Hello Ali Kitabi,

    Please check our online example demonstrating server-side events of RadListBox here, note that AllowPostBackOnTransfer property for the first listbox should be set to "true".

    Sincerely yours,
    Yana
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ali Kitabi
    Ali Kitabi avatar
    8 posts
    Member since:
    Nov 2008

    Posted 12 May 2010 Link to this post

    Hi Yana,

    I was trying this example only but it was not working for some unforeseen reason. However I do have found a solution for the problem, for those who might need it at some point.

    Markup:

     

    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    </telerik:RadScriptManager> 
    <telerik:RadListBox ID="RadListBox1" runat="server" TransferToID="RadListBox2" AllowTransfer="True" AllowTransferDuplicates="True" AutoPostBack="true" > 
    </telerik:RadListBox> 
    <telerik:RadListBox ID="RadListBox2" runat="server" AutoPostBack="true" > 
    </telerik:RadListBox> 

    Code Behind:

            protected override void OnInit(EventArgs e)  
            {  
                base.OnInit(e);  
                RadListBox1.AutoPostBackOnTransfer = true;  
                RadListBox1.Transferring += new RadListBoxTransferringEventHandler(RadListBox1_Transferring);  
                RadListBox1.Transferred += new RadListBoxTransferredEventHandler(RadListBox1_Transferred);  
                RadListBox2.Inserted += new RadListBoxEventHandler(RadListBox2_Inserted);  
                RadListBox2.Transferring += new RadListBoxTransferringEventHandler(RadListBox2_Transferring);  
                RadListBox2.Transferred += new RadListBoxTransferredEventHandler(RadListBox2_Transferred);  
            }  
     
            void RadListBox2_Inserted(object sender, RadListBoxEventArgs e)  
            {  
                  
            }  
     
            void RadListBox2_Transferred(object sender, RadListBoxTransferredEventArgs e)  
            {  
                  
            }  
     
            void RadListBox2_Transferring(object sender, RadListBoxTransferringEventArgs e)  
            {  
                  
            }  
     
            void RadListBox1_Transferred(object sender, RadListBoxTransferredEventArgs e)  
            {  
                  
            }  
     
            void RadListBox1_Transferring(object sender, RadListBoxTransferringEventArgs e)  
            {  
                  
            }  
     
            protected void Page_Load(object sender, EventArgs e)  
            {  
                  
                if (!IsPostBack)  
                {  
                    RadListBox1.Items.Add(new RadListBoxItem("1""1"));  
                    RadListBox1.Items.Add(new RadListBoxItem("2""2"));  
                    RadListBox1.Items.Add(new RadListBoxItem("3""3"));  
                    RadListBox1.Items.Add(new RadListBoxItem("4""4"));  
                }  
            } 

    I hope this helps someone.

    Regards,

    Ali
    Shipcom Wireless. INC.

Back to Top