This project is read-only.

Change colour of column

Apr 27, 2013 at 5:51 PM
Hi,
First of all, I want to say that "GridMvc" is just an awesome software. But I want to know whether it is possible to change the colour of a specific column (in a very easy way) ? It will be very helpful for me.

Thanks in advance
Apr 29, 2013 at 4:41 AM
Hi, thanks

I think the easiest way is to add new css rule in your stylesheet:
table.grid-table td.grid-cell:nth-child(<N>) { background:#FCF8E3; }
where <N> - 1,2,3 .. - order number of the column
Apr 29, 2013 at 6:34 AM
Ok, thank you very much ;)
May 29, 2013 at 10:53 PM
Bukharin wrote:
Hi, thanks

I think the easiest way is to add new css rule in your stylesheet:
table.grid-table td.grid-cell:nth-child(<N>) { background:#FCF8E3; }
where <N> - 1,2,3 .. - order number of the column
The above works great in FireFox, but not IE8. I think a new feature that works like the .SetWidth(n). Something like .SetCss(x) or .SetStyle(x)
May 31, 2013 at 7:37 AM
:nth-child css selector works only in IE9+. But for older IE versions you can use js script, like:
<script>
$("table.grid-table td.grid-cell:nth-child(<N>).css('background-color','#FCF8E3');
</script>