[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 267
  • Last Modified:

ASP.net font in Extra button column

Hi

I am using the code below to create an extra button column in my ASP.net 4
GridView.
I need to make the font smaller. How do I do this?
The image below shows what comes up in Windows Explorer image
<asp:TemplateField HeaderText="Strongly Agree">
                  <ItemTemplate>
                    <asp:Button ID="Button1" runat="server" 
                      CommandName="MyButton1" 
                      CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>"
                      Text="Strongly Agree" />
                  </ItemTemplate>

Open in new window

0
Murray Brown
Asked:
Murray Brown
1 Solution
 
dexterrajeshCommented:
hi,
set the style property property for the button control mentioning the font-size  attribute

<asp:TemplateField HeaderText="Strongly Agree">
                  <ItemTemplate>
                    <asp:Button ID="Button1" runat="server"
                      CommandName="MyButton1"
                      CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>"
                      Text="Strongly Agree"
                       Style="font-size:small;" />
                  </ItemTemplate>
0
 
Ramkisan JagtapLead DeveloperCommented:
Write a css class
.gridButton
{
font-size: 9px; /* It will change as per your Requrement*/
}


<asp:TemplateField HeaderText="Strongly Agree">
                  <ItemTemplate>
                    <asp:Button ID="Button1" runat="server"
                      CommandName="MyButton1"
                      CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>"
                      Text="Strongly Agree" CssClass="gridButton" />
                  </ItemTemplate>
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
thanks very much
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now