Making columns visible/invisible on runtime in a subform

Mymoon
Member Posts: 6
Hi,
i have a main-form and a subform on it. There are two radio buttons on the main form.
When I choose one of radio buttons on main-form, i want one of my subform's colums to be visible and another invisible. When i choose the other radio button, i want to reverse each other.
Does anyone have a solution for it?
{
This is what i have done:
I first read the parameter via radio buttons and activated the subform control of main-form.
On-activate trigger of subform, i called a function from main-form to read the parameter. But the parameter brings its default value all the time. So it doesnt work to set the visible property of columns using the parameter.
I tried to understand how CodeUnit 408 (Dimension Management) is working. But it looks complex.
}
Any idea, solution or knowledge about CodeUnit408 is wellcomed.
Thank you...
i have a main-form and a subform on it. There are two radio buttons on the main form.
When I choose one of radio buttons on main-form, i want one of my subform's colums to be visible and another invisible. When i choose the other radio button, i want to reverse each other.
Does anyone have a solution for it?
{
This is what i have done:
I first read the parameter via radio buttons and activated the subform control of main-form.
On-activate trigger of subform, i called a function from main-form to read the parameter. But the parameter brings its default value all the time. So it doesnt work to set the visible property of columns using the parameter.
I tried to understand how CodeUnit 408 (Dimension Management) is working. But it looks complex.
}
Any idea, solution or knowledge about CodeUnit408 is wellcomed.
Thank you...
0
Comments
-
as easy as ABC!
In your subform create a function like this:SetColumnVisible(Par : Option) CASE Par OF 0:BEGIN CurrForm.Column1.VISIBLE := TRUE; CurrForm.Column2.VISIBLE := FALSE; END; 1:BEGIN CurrForm.Column1.VISIBLE := FALSE; CurrForm.Column2.VISIBLE := TRUE; END; END;
In main-form in radiobutton`s trigger OnAfterValidate write this code:CurrForm.SalesLines.FORM.SetColumnVisible(YourOptionVariable);
You must write those code two times for each radiobutton`s OnAfterValidate trigger.
Make sure that you correctly fill SourceExpr and OptionValue properties of radiobuttons.0 -
Hello and thanx a lot 8)
Actually it was the first method i've tried but with one difference.
In radio-buttons validate trigger, i called the subform's function directly like this:SalesOrder.SetColumnVisible(OptionVariable);
There was no change in columns after that. So i thought that i cant change the visibility of columns without activating the form.
Thanks again...0 -
So i thought that i cant change the visibility of columns without activating the form
Believe me - you can do it since i`ve done it!
Just do it in exactly same way that i say.
You need OnAfterValidate trigger.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions