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
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
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
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
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
}
Thanks
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...
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...
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
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.
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
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.
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
Our thoughts here at Progress are with those affected by the outbreak.