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

Married Scrolling Between Two Listboxes

2 Answers 57 Views
ComboBox and ListBox (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jeremy Murtishaw
Top achievements
Rank 1
Jeremy Murtishaw asked on 06 Aug 2009, 07:19 PM
Hello,

I'd like to have two listboxes side by side that scroll together, much like you would see in a diff or merge tool. Is there some way that this can be accomplished with Telerik ListBoxes?

Thanks!
Jeremy

2 Answers, 1 is accepted

Sort by
0
Accepted
Aaron
Top achievements
Rank 2
answered on 06 Aug 2009, 07:38 PM
Jeremy,

This is possible, and very easy to do. See my example code below.

    public partial class Form1 : Form 
    { 
        public Form1() 
        { 
            InitializeComponent(); 
 
            radListBox1.ListBoxElement.Scroll += new Telerik.WinControls.UI.RadScrollPanelHandler(ListBoxElement_Scroll); 
        } 
 
        void ListBoxElement_Scroll(object sender, Telerik.WinControls.UI.ScrollPanelEventArgs args) 
        { 
            radListBox2.ListBoxElement.ScrollLayoutPanel.ScrollTo(args.NewValue.X, args.NewValue.Y); 
        } 
    } 

- Aaron


0
Jeremy Murtishaw
Top achievements
Rank 1
answered on 07 Aug 2009, 04:54 PM
Thanks Aaron! Worked perfectly :-)

Jeremy
Tags
ComboBox and ListBox (obsolete as of Q2 2010)
Asked by
Jeremy Murtishaw
Top achievements
Rank 1
Answers by
Aaron
Top achievements
Rank 2
Jeremy Murtishaw
Top achievements
Rank 1
Share this question
or