This is a migrated thread and some comments may be shown as answers.

CommandItemStyle background

2 Answers 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephan
Top achievements
Rank 1
Stephan asked on 12 Mar 2009, 06:14 PM
I'm using the Vista skin for my RadGrid, but I would like to be able to change the background color for the, what I thought, CommandItem row.
When I change the background on the CommandItemStyle in my ascx file, only the bottom 10px or so change the background color in the command row. Setting the Skin=" ", which should reset the RadGrid's skin to nothing and give me a clean slate doesn't make a difference either.
I know I can achieve this by using the CommandItemTemplate, but that also requires me to add the menu items that are otherwise already there (like "Add New Record" or "Refresh").

Is there a way to have this background color be pulled from a CSS so that all my RadGrids look the same?
Do I have to customize the Vista skin and change it in there somehow and create my own custom skin?
I just feel like I'm making it too complicated at this point, but maybe there really isn't an "easy" way to accomplish what I'm going for.


2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 13 Mar 2009, 07:28 AM
Hi,

You need to add !Important keyword to the styles inorder to override the preset styles in the skin. Check out the code below to set the style for Command Row using Vista skin:

<style type="text/css"
.GridCommandRow_Vista 
   { 
    background:url('') !important; 
    background-color: Green !important;  
   } 
</style>  

Thanks
Princy.
0
Stephan
Top achievements
Rank 1
answered on 13 Mar 2009, 01:44 PM
That did it.

Thanks you very much.
Tags
Grid
Asked by
Stephan
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Stephan
Top achievements
Rank 1
Share this question
or