Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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.</p> <p>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.</p> <p>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.</p> <p>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.</p> <p>for example</p> <pre><code>public String DateDisplay1 public String DateDisplay1Colour </code></pre> <p>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.</p> <p>so if DateDisplay1 is on row1 then in the onRowDataBound(e) function I would have something like</p> <pre><code>if (e.dataItem.DateDiplay1Colour == "Green") { e.row.cells[1].style.backgroundColor = "#7EDF7D"; } </code></pre> <p>this way you can still display the date in it's cell and then display the colour based off it's corresponding hidden value.</p> <p>then same can be done with admin powers so if a user isn't an admin then</p> <pre><code>row.cells[6].innerHTML = '&lt;readonly&gt;' + "Edit" + '&lt;/readonly&gt;'; </code></pre> <p>thus getting rid of the link allowing a user to edit that record.</p> <p>Hope this helps some people and I hope telerik gets round to unlocking my topics so I can add on the solution I found.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload