Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6192953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:02:06+00:00 2026-05-24T03:02:06+00:00

I’d prefer for either string or int but would settle for it based on

  • 0

I’d prefer for either string or int but would settle for it based on bit.

The Goal is if the value of a String field == ‘blah blah blah’ that it will turn that whole row grey(blue table with red and green already used on it so I’m open to any other colour suggestion)

I’ve tried

.RowAction(row =>
    {
        if (row.DataItem.[Bound Data col Name] == "[String value]")
        {
            row.HtmlAttributes["style"] = "background:grey;";
        }
    }) 

and

.RowAction(row =>
    {
        if (row.DataItem.[Bound Data col Name] == "[String value]")
        {
            row.Grid.HtmlAttributes["style"] = "background:grey;";
        }
    }) 

and

.ClientEvents(events => events.OnRowDataBound("onRowDataBound"))
function onRowDataBound(e) {
    if (e.dataItem.[Bound Data col Name] == "[String value]") {
        e.row.style.backgroundColor = "grey";
    }
}

all of these didn’t work in the slightest and these are the only clear examples for mvc on how to do this so anybody got any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:02:07+00:00Added an answer on May 24, 2026 at 3:02 am

    Well took forever but telerik finally admitted that there was a bug with Cellaction on the open source version which they had address on the commercial version (http://www.telerik.com/community/forums/aspnet-mvc/grid/cell-action-issue-evidence-provided.aspx), it only took 2 locked topics until they finally accepted what I’d been telling them the whole time.

    Long story short if you want to do something like this an encounter issues with Cellaction then either buy the commercial version or follow the steps below.

    Simple add an extra field into your DTO for each cell you want to change the colour of, in my case I had 6 dates which depending on how close to present date they got would vary their colour.

    You would then in the controller do all the date calculations and depending on how close it got would record the colour to it’s corresponding DTO item.

    for example

    public String DateDisplay1
    public String DateDisplay1Colour
    

    then you would hide the colour item on the grid and use it’s value to change the colour of the row which DateDisplay1 is on.

    so if DateDisplay1 is on row1 then in the onRowDataBound(e) function I would have something like

    if (e.dataItem.DateDiplay1Colour == "Green") {
    
            e.row.cells[1].style.backgroundColor = "#7EDF7D";
        }
    

    this way you can still display the date in it’s cell and then display the colour based off it’s corresponding hidden value.

    then same can be done with admin powers so if a user isn’t an admin then

    row.cells[6].innerHTML = '<readonly>' + "Edit" + '</readonly>';
    

    thus getting rid of the link allowing a user to edit that record.

    Hope this helps some people and I hope telerik gets round to unlocking my topics so I can add on the solution I found.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
Specifically, suppose I start with the string string =hello \'i am \' me And
Seemingly simple, but I cannot find anything relevant on the web. What is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.