ScrollEvent not triggered

13 posts, 1 answers
  1. Txarlie
    Txarlie avatar
    1 posts
    Member since:
    Aug 2010

    Posted 13 Aug 2010 Link to this post

    Hello,

    I'm trying to run the RadGridView1_Scroll event in my application, but it is never triggered. I have tried in VB.NET and C#, and both Scroll events are not run.

    Do I need to set any property first?

    I verified the event handler and they are correctly defined.

    In addition I've built another two projects in C# and VB.NET to test the Scroll event of the common GridView from Visual Studio. And the run ok.

    Any help will be welcome. Thank you in advance.

    Best regards,
    Txarlie
  2. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 18 Aug 2010 Link to this post

    Hello Carlos,

    Thank you for writing.

    I have investigated your case and it seems that we have an issue with this event. I have logged it into our PITS (Public Issue Tracking System) and we are going to fix it in a future release. You can subscribe for this issue at this link in order to receive status updates.

    I have updated your telerik points as a token of our gratitude. If there is anything else we can help you with, do not hesitate to contact us.

    Kind regards,
    Stefan
    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. Morne
    Morne avatar
    1 posts
    Member since:
    Jan 2012

    Posted 01 Mar 2012 Link to this post

    Hi, 

    I have the exact same problem. The scroll event is never triggered.

    I created a new test application just to double check, and still the scroll event never gets triggered.
    Current grid version is 2012.1.12.0215

    Thanks

  4. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 06 Mar 2012 Link to this post

    Hello Morne,

    Here is an update regarding this case. 

    RadGridView uses its own elements for scrolling. This enables advanced visual styles to be applied on the grid scrollbars. Instead of using the Scroll event inherited from the default Control class, you can handle RadGridView.TableElement.VScrollBar.Scroll or RadGridView.TableElement.HScrollBar.Scroll events.

    I hope this helps.
     
    All the best,
    Stefan
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  5. Answer
    Anderson Godoy
    Anderson Godoy avatar
    3 posts
    Member since:
    Mar 2010

    Posted 06 Mar 2012 Link to this post

    Hi
    Synchronizing between 2 Horizontal Scroll RadGridView
    Using this event to update the values ​​of the horizontal scroll

    RadGridView1.TableElement.HScrollBar.ValueChanged + = new EventHandler (RadGridView1_HScroll_ValueChanged);
     
    protected void RadGridView1_HScroll_ValueChanged (object sender, EventArgs e)
             {
                     RadScrollBarElement oScroll1 = RadGridView1.TableElement.HScrollBar;
                     RadScrollBarElement oScroll2 = RadGridView2.TableElement.HScrollBar;
     
                     oScroll2 Maximum = oScroll1.Maximum / / Set the maximum value of the scroll;
             oScroll2.Value = oScroll1.Value;            // Set the Value Scroll 1 to Scroll 2
             }

  6. Jaco
    Jaco avatar
    1 posts
    Member since:
    Feb 2012

    Posted 07 Mar 2012 Link to this post

    Exactly what i wanted to do and it is working like a charm.

    Thanks
  7. Shanthosh
    Shanthosh avatar
    8 posts
    Member since:
    Feb 2019

    Posted 11 Feb 2019 in reply to Txarlie Link to this post

    Hi

    i have some doubt regards radgrid view scroll event

    basically its not working on radgrid view apart from radgrid view using scroll event it was working fine...

    can u say using shift + mousewheel move a page horizontally in mousewheel event...

  8. Shanthosh
    Shanthosh avatar
    8 posts
    Member since:
    Feb 2019

    Posted 11 Feb 2019 in reply to Stefan Link to this post

    i have some doubt regards Radgrid view scroll event
    basically its not working on Radgrid view, apart from radgrid view using scroll event it was working fine...
    can u say using shift + mouse wheel to move a page horizontally in mouse wheel event...
  9. Hristo
    Admin
    Hristo avatar
    1519 posts

    Posted 12 Feb 2019 Link to this post

    Hello Shanthosh,

    I am not sure that I understand very well the first part of your question. If you need to handle the scroll events of the grid please consider subscribing the ValueChanged events on the horizontal and vertical scrollbars as already discussed. If I have correctly understood the second part of your question, you need to horizontally scroll the grid holding the Shift key and using the mouse wheel. In order to accomplish this, you can handle the MouseWheel event and then adjust the horizontal scrollbar value: 
    private void RadGridView1_MouseWheel(object sender, MouseEventArgs e)
    {
        if (Control.ModifierKeys == Keys.Shift)
        {
            HandledMouseEventArgs args = (HandledMouseEventArgs)e;
            args.Handled = true;
     
            int step = Math.Max(1, e.Delta / SystemInformation.MouseWheelScrollDelta);
            int delta = Math.Sign(e.Delta) * step * SystemInformation.MouseWheelScrollLines;
            RadScrollBarElement scrollbar = this.radGridView1.GridViewElement.TableElement.HScrollBar;
            int result = scrollbar.Value - delta * scrollbar.SmallChange;
            if (result > scrollbar.Maximum - scrollbar.LargeChange + 1)
            {
                result = scrollbar.Maximum - scrollbar.LargeChange + 1;
            }
            if (result < scrollbar.Minimum)
            {
                result = scrollbar.Minimum;
            }
     
            scrollbar.Value = result;
        }
    }

    I am also attaching a short video showing the result on my end. I hope this will help.

    Regards,
    Hristo
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  10. Shanthosh
    Shanthosh avatar
    8 posts
    Member since:
    Feb 2019

    Posted 12 Feb 2019 in reply to Hristo Link to this post

    Hi Hristo's,

    ur using a form winows, but im using wpf windows, totally i got a error using ur code mainly control.modifierskeys is getting error while using controls... if u have some other code with xaml pl post it.

  11. Hristo
    Admin
    Hristo avatar
    1519 posts

    Posted 13 Feb 2019 Link to this post

    Hi Shanthosh,

    This forum thread is about the Telerik UI for WinForms RadGridView control. As you are using the WPF grid control, please post your question here: https://www.telerik.com/forums/wpf.

    Regards,
    Hristo
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  12. James
    James avatar
    21 posts
    Member since:
    Nov 2017

    Posted 05 Jun Link to this post

    For any people that are scratching their head trying to get this to work, if you subscribe to the ValueChanged event before binding data to the grid, it unsubscribes the event. Subscribe to the event after the data is bound to the grid and it'll work.

     

  13. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3891 posts

    Posted 10 Jun Link to this post

    Hello, James, 

    Thank you for sharing your tip with the community. 

    However, the ValueChanged event for the horizontal/vertical scrollbars are successfully fired on my end event when I subscribe to the ValueChanged event before setting the RadGridView.DataSource. Please refer to the attached gif file. Am I missing something? 

    I have attached my sample project. Could you please specify the exact steps how to reproduce the problem? Thank you in advance. 

    I am looking forward to your reply.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
Back to Top