Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1015
Scrolling the WinGrid via touch (like an iPad)
posted

I am creating an application using UltraWinGrid for a WinXP touchpad. I would like to get the scrolling capability in the grid like on an iPad - swipe up to scroll down, swipe down to scroll up. Can I get this capability?

If it's not possible in WinXP, is it possible in WIn7?

Parents
No Data
Reply
  • 48586
    posted

     

    Hello,

     

    Currently UltraGrid doesn’t support such functionality, but you could achieve this, if you are  handling  mouse move event of the UltraGrid and use code like:

    if (ultraGrid1.Capture)

                {

                    int abs = Math.Abs(e.Y - oldPosition.Y);

                    if ( abs> 10)// determine if user hit to scroll

                    {

                        int adjust = (e.Y - oldPosition.Y);

                        int sign = adjust > -1 ? -1 : 1;//direction of scrolling - up or down

                        //cause scrolling to be fast at the beginning and to slow down at the end

                        for (int i = 0; i < abs; i +=1)

                        {

                            ultraGrid1.DisplayLayout.RowScrollRegions[0].ScrollPosition += (int)(((e.Y - oldPosition.Y) + sign*i)*0.02);

                            ultraGrid1.Refresh();

                        }

                       

                    }

                    else

                        ultraGrid1.DisplayLayout.RowScrollRegions[0].ScrollPosition += e.Y - oldPosition.Y;

                    oldPosition = e.Location;

                }

     

    I am attaching the sample which I have created.

     

    Please let me know if you have any further questions.

    WindowsFormsApplication27.zip
Children