Conditional coloring in a repeater

poppins
poppins Member Posts: 647
edited 2015-09-11 in NAV Three Tier
Hi everyone,

I have to do some conditional coloring for lines in a repeater.
I am doing some checks on the lines before closing the page(code is on OnQueryClosePage trigger), and if some values are wrong, the line has to become red or something like that.Otherwise, the line should remain the same.
Is it achievable in NAV 2015?

Thanks in advance :mrgreen:

Comments

  • apertierra
    apertierra Member Posts: 61
    Check the property Style and the property Styleexpr on the control you want to change the color for.
    To put it in few words, Style to set what style to use and then Styleexpr to control with a boolean variable when to use that style or use the default color.
  • rocatis
    rocatis Member Posts: 163
    It should be noted, that in an effort to prevent us from designing pages that look even half decent, Microsoft have ensured that we can only use one Style - we cannot switch between multiple styles.
    Brian Rocatis
    Senior NAV Developer
    Elbek & Vejrup
  • SeeSharp
    SeeSharp Member Posts: 19
    For each column you wish to style set the style to one of the following as seen on MSDN

    Then set the '
    StyleExpr
    
    ' to a boolean. I used 'ColourLine'

    On '
    OnAfterGetRecord()
    
    ' on your List Page do the following:
    ColourLine := (i MOD 2) = 0;
    i += 1;
    
  • lakshanvindana
    lakshanvindana Member Posts: 79
    it is possible.

    refer the page "Apply Vendor Entries" (233) and the coding on table "Vendor Ledger Entry"
    Lakshan Kulawansa
    ERP Consultant - MS Dynamics NAV
    https://lk.linkedin.com/pub/lakshan-vindana-kulawansa/37/2a2/592