Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Unanswered

Using DisplayOption method to colourize rows in a grid

Posted on by 11,873

DisplayOption   is  used to colourize  rows in a gird based on field value the issue is that when a row is selected its colour is missed , how can I keep the colour of the selected record ? the grid property highlight active is marked as no 

  • Vishal Dhavgaye Profile Picture
    Vishal Dhavgaye 405 on at
    RE: Using DisplayOption method to colourize rows in a grid

    Try if this works for you, This worked for me. 

    public void displayOption(Common _record, FormRowDisplayOption _options)
    
    {
        super(_record, _options);
        RequestHelper::modifyGridcolorOnStatus(_record, _options);
    }
    
    
    
    Class RequestHelper -
    
    public static void modifyGridcolorOnStatus(Common _record, FormRowDisplayOption _options)
    { 
        RequestTable requestTable = _record as RequestTable; 
        _options.backColor(RequestHelper::setRequestStatusColor(requestTable));
    }
    
    public static CCColor setRequestStatusColor(RequestTable _requestTable)
    {
        CCColor color = WinApi::RGB2int(255,255,255);
        
        if (requestTable.staus == XXX)
        {
            color = asuInventRequestStatusColor.Color;
        }
        
        return Color;
    }
     
    
    

  • maram fraij Profile Picture
    maram fraij 11,873 on at
    RE: Using DisplayOption method to colourize rows in a grid

    Is it possible to disable row selection in gird ?

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,253 Super User 2024 Season 2 on at
    RE: Using DisplayOption method to colourize rows in a grid

    Hi Maram,

    A selected record will always have the color as per selection (style). You can't override this behavior.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans