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

ScrollEvent not triggered

12 Answers 637 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Txarlie
Top achievements
Rank 1
Txarlie asked on 13 Aug 2010, 10:45 AM
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

12 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 18 Aug 2010, 05:15 PM
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
0
Morne
Top achievements
Rank 1
answered on 01 Mar 2012, 01:07 PM
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

0
Stefan
Telerik team
answered on 06 Mar 2012, 09:48 AM
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 >>
0
Accepted
Anderson Godoy
Top achievements
Rank 1
answered on 06 Mar 2012, 02:32 PM
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
         }

0
Jaco
Top achievements
Rank 1
answered on 07 Mar 2012, 01:17 PM
Exactly what i wanted to do and it is working like a charm.

Thanks
0
Shanthosh
Top achievements
Rank 1
answered on 11 Feb 2019, 10:07 AM

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...

0
Shanthosh
Top achievements
Rank 1
answered on 11 Feb 2019, 10:08 AM
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...
0
Hristo
Telerik team
answered on 12 Feb 2019, 02:18 PM
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.
0
Shanthosh
Top achievements
Rank 1
answered on 13 Feb 2019, 03:07 AM

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.

0
Hristo
Telerik team
answered on 13 Feb 2019, 07:30 AM
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.
0
James
Top achievements
Rank 1
Veteran
answered on 05 Jun 2020, 05:12 PM

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.

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 10 Jun 2020, 05:08 AM

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.
Tags
GridView
Asked by
Txarlie
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Morne
Top achievements
Rank 1
Anderson Godoy
Top achievements
Rank 1
Jaco
Top achievements
Rank 1
Shanthosh
Top achievements
Rank 1
Hristo
Telerik team
James
Top achievements
Rank 1
Veteran
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or