web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Auto-scroll a Grid

(0) ShareShare
ReportReport
Posted on by 1,447

Hi,

How do I make a grid control scroll to the right/left in X++ code?

Is there an event that fires when I scroll the grid in the form?

Is there any methods that I could use or even override to make this possible?

As a last resort, I am thinking of using Win32 API functions to achieve this.

Let me know what you think. Thanks!

Regards,

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at
    RE: Auto-scroll a Grid

    I think you need to find a Win32 API function for that.

  • Suggested answer
    Jonathan  Halland Profile Picture
    11,310 on at
    RE: Auto-scroll a Grid

    Hi DJRM.

    An option is to declare the columns as "autodeclaration" and then call columnName.setFocus(); on the outer column. I tested this an it does work.

  • Jonathan  Halland Profile Picture
    11,310 on at
    RE: Auto-scroll a Grid

    You can also do so a bit more dynamically using the grid's ControlCount and ControlNum methods... (see silly example below)

    FormControl ctrl;

       int i;

       for(i=1;i<=MyGrid.controlCount();i++)

       {

           ctrl = MyGrid.controlNum(i);

           ctrl.setFocus();

       }

  • DJRM Profile Picture
    1,447 on at
    RE: Auto-scroll a Grid

    This is the real problem: I want the other grid to scroll as well when I am scrolling the 1st grid. So simply put, two grids will scroll at the same time. Is this possible?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#2
Community Member Profile Picture

Community Member 2

#2
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans