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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Resize column width in X++

(0) ShareShare
ReportReport
Posted on by 1,447

Hi all,

I have a Grid in a form which has 2 columns: A & B. I also have a button: C. The grid and the columns are set to "ColumnWidth" property. Column A is auto-declaration to TRUE. How do I set the width of column A in code when I click on Button C? Of course, I know that I need to override the "clicked ()" method of the button and that is where I put the code.

I tried to do something like: SomeStringControl.width(250) or even SomeStringControl.widthValue(100);

Please help.

*This post is locked for comments

I have the same question (0)
  • Jonathan  Halland Profile Picture
    11,310 on at

    Hi

    DJRM, Your code looks correct and works on a test I have just done, have you got any specific issues?

  • DJRM Profile Picture
    1,447 on at

    How did you do this? can you show a code snippet? thanks! what form template did you use? What values did you specify in the width and height properties of the grid and column?

  • Verified answer
    Jonathan  Halland Profile Picture
    11,310 on at

    2015_2D00_06_2D00_19_5F00_0931.png

  • Suggested answer
    Faisal Fareed Profile Picture
    10,796 User Group Leader on at

    Hi DJRM, You can set the width and height of any object on the form by setting its AutoDeclaration property = YES and then use it in your code by its name as you did. There is no restriction with the form design it should work with all form designs. However, there might be a case you put your control inside a group and changed width of the control but missed to change the width of group. Try to change width of group if you have any.

  • Jonathan  Halland Profile Picture
    11,310 on at

    Hi DJRM, were you able to resolve this issues?

  • DJRM Profile Picture
    1,447 on at

    Yes. Thanks a lot! As it turns out the user setting for the form was the one causing problems.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans