Asp.net 2.0 - Gridview Skin and CSS Question

lakhi
lakhi used Ask the Experts™
on
I have a web application that has several pages each with its own gridview. I want to use a skin file so each will have a consistant look.
I would like to be able to get each row's control field displayed as a button rather than a link but when I add <Columns> to the skin file, the gridview displays only the command field and no data. I'm attaching both the skin file and the CSS file.
If I delete, the "Columns" portion of the skin file, it works but the default command field is diaplayed.
Is there any way to do this where I don't have to add code for the command field on each page?
Thanks in advance for any help.
(Skin File)
<asp:GridView runat="server" SkinID="Admin" CssClass="DataWebControlStyle">
<AlternatingRowStyle CssClass="AlternatingRowStyle" />
<RowStyle CssClass="RowStyle" />
<HeaderStyle CssClass="HeaderStyle" />
<PagerStyle CssClass="PagerStyle" />
<Columns>
<asp:CommandField ShowEditButton="True" >
<ControlStyle CssClass="ControlStyle" />
</asp:CommandField>
</Columns>
</asp:GridView>

CSS FILE
.DataWebControlStyle {
	color: #333333;
	font-size: small;
	padding: 5;
} 

.HeaderStyle {
	background-color: #d08688;
	color: White;
	font-weight: bold;
	font-size: small;
	font-family: Times New Roman;
}
.HeaderStyle A:Link {
color: White; }

.AlternatingRowStyle {
	background-color: White;
	color: #BD5356;
}
.RowStyle {
	background-color: #f2dddd;
	color: #792f30;
}
.ControlStyle {
	color: #91393b;
} 
.PagerStyle {
	background-color: #9e3d40;
	font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
	font-size: xx-small;
	color: White;
}
.PagerStyle A:Link {
color: White; }

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2012
Top Expert 2008
Commented:
If you define columns in the skin file for the GridView, then it overrides what the web page is defining for columns.  I don't believe that you can pre-defined CommandField columns in a skin file that way...

Author

Commented:
Thanks!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial