473,796 Members | 2,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I set ButtonField style from theme file?

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?
Feb 2 '07 #1
1 4492
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" AutoGenerateCol umns="false">
<Columns>
<asp:TemplateFi eld>
<ItemTemplate >
<asp:HyperLin k runat="server" ID="link" SkinID="Red"
Text="Click me!" NavigateUrl="#" CommandName="Se lect"/>
</ItemTemplate>
</asp:TemplateFie ld>
</Columns>
</asp:GridView>

-- and the skin file --
<asp:HyperLin k runat="server" ForeColor="Red" SkinID="Red"/>
--
Milosz
"Harry Keck" wrote:
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?
Feb 2 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2906
by: James Alba | last post by:
Hi all, being new to C# (not to C++), when I create a windows form and run it, regardless if the windows operating system is using the "new" XP theme or the "old" 95/98/2000 styled theme, my forms use the old 95/98 style theme. How do I get the new XP "look and feel" theme for my buttons and tab panes and other controls? You know, the one where if you hover the mouse over button, a thin yellow line at the base appears. Using MFC /...
1
4948
by: lanem | last post by:
I have a gridview. One of the columns is a buttonfield. I use the datatextfield property of buttonfield to show my bound value as a hyperlink in each buttonfield cell. I then want to get that text in the rowdatabound event. I can get it easily for each boundfield cell but not for the buttonfield. Please help. Thanks.
6
1342
by: Mike Grace | last post by:
Hi, Sorry for the stupid question but :- Am I correct in thinking that a CSS style sheet file only affects HTML elements and not asp.net controls and that the skin file is used for this? I am trying to set up a theme and no matter what I put in the CSS file, it doesn't seem to have any effect on my pages.
0
1038
by: Jeff | last post by:
hey asp.net 2.0 Below I'm trying to specify a ButtonField. The problem is that when I click on the ButtonField (CommandName = UserName) I don't get info the UserName in the gvwUsers_RowCommand. In the code below I'm trying to assign a variable the value of "UserName" column (string username = gridRow.Cells.Text;) but the variable get set to ""...
3
22531
by: GaryDean | last post by:
I have a button field in a gridview defined as follows: <asp:ButtonField ButtonType="Button" CommandName="AcceptOrder" Text="Accept Whole Order"> <ControlStyle Font-Size="X-Small" /> </asp:ButtonField> In the RowCommand event I have the following code: if ((string)e.CommandName.ToLower() == "acceptorder") { int myRow = int.Parse(e.CommandArgument.ToString());
0
1721
by: Lovely Angel For You | last post by:
Hi All, I am very new to vb.net. I have just started migrating from VB6 to VB.net. However I have a very basic query. I wanted to know if there is any way I can style my drop downs. I mean not only the colors, or fonts, the styles as well. How does the drop down arrow looks like. Does it have to be rectangle only. I want them rounded. And lots of other things. I am using xp and users of the application will also be using
3
4057
by: Dave Hughes | last post by:
Hi, I've run across a problem styling form controls (quel surprise), or rather in this case, "unstyling" them. I'm trying to put together a theme for a web application which has a fairly primitive theme engine. Specifically, I can define *additional* CSS rules using the theme engine, but I can't remove the pre-existing ones that come with the application. For the vast majority of the theme this hasn't been a problem given that...
1
2032
by: JLC | last post by:
For some reason I am getting this error. Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ButtonField' Here is my code for my .aspx file <asp:ButtonField ItemStyle-Wrap="false" ButtonType="Link" HeaderText="Status" DataTextField="clusterStatusName" CommandName="update" />
5
10504
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a machine running IIS 6.0. I just replaced the web.config and several aspx pages in the application and now the style sheets are not working. the images from the themes work but not the css files. Any help. -- Jerry
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10465
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10242
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10200
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4127
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2931
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.