How do I set ButtonField style from theme file?

G

Guest

I am using ASP.Net 2.0 themes, and have a GridView with a ButtonField column.
I can not find a way to create a style for ButtonField columns in the
application's theme, specifically, I want to set the ControlStyle-Font-Size
property. Is there a way to do this, or would I have to set the style in
every place that I use a ButtonField column?
 
G

Guest

Howdy,

Because ButtonField is not actually a control, it only provides information
necessary to generate and render a column in gridview. Therefore you cannot
use Skin/Theme feature. As a work around i would suggest TemplateField:

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink runat="server" ID="link" SkinID="Red"
Text="Click me!" NavigateUrl="#" CommandName="Select"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

-- and the skin file --
<asp:HyperLink runat="server" ForeColor="Red" SkinID="Red"/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top