Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1061383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:27:58+00:00 2026-05-16T18:27:58+00:00

Can i in GridView add css to only first(headr) tr. I know how to

  • 0

Can i in GridView add css to only first(headr) tr. I know how to add css to th inside header trr but i don’t know if is possible to add css to trr?

GRIDVIEW:

<asp:GridView ID="gwCompanies" runat="server" AutoGenerateColumns="false">
        <Columns>            
            <asp:TemplateField HeaderText="Ime">               
                <ItemTemplate>
                    <asp:Image ID="imgServiceOpen" runat="server" ToolTip="Restavracija sprejema naročila" ImageUrl="~/Images/cheff-icon.png" Visible='<%# Convert.ToBoolean(Eval("ServiceOpen")) %>' />
                    <asp:HyperLink ID="hlEdit" runat="server" NavigateUrl='<%# GetOrderArticlesUrl(Eval("CompanyId")) %>'>
                        <asp:Label ID="lblName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                    </asp:HyperLink>
                </ItemTemplate>                
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Naslov">
                <ItemTemplate>
                    <asp:Label ID="lblFullAddress" runat="server" Text='<%# GetFullCompanyAddress(Container.DataItem) %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
            <asp:Label ID="lblEmptyCompaniesGrid" runat="server" Text="Ne najdem restavracij!"></asp:Label>
        </EmptyDataTemplate>
    </asp:GridView>

output i want

<table id="rest_list">

  <tr class="top_tab">
    <td class="top_tab_title">Ime</td>
    <td class="top_tab_title">Naslov</td>
  </tr>

  <tr>
    <td class="rest_name"><a href="#" title="Murka">Murka</a></td>
    <td>Točen naslov pizzerije</td>
  </tr>

  <tr>
    <td class="rest_name"><a href="#" title="Lastoria">Lastoria</a></td>
    <td>Točen naslov pizzerije</td>
  </tr>

  <tr>
    <td class="rest_name"><a href="#" title="Skok">Skok</a></td>
    <td>Točen naslov pizzerije</td>
  </tr>

  <tr>
    <td class="rest_name"><a href="#" title="Tara">Tara</a></td>
    <td>Točen naslov pizzerije</td>
  </tr>

</table>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:27:59+00:00Added an answer on May 16, 2026 at 6:27 pm

    You can add a class with the HeaderStyle property, like this:

    <asp:GridView ID="gwCompanies" runat="server" AutoGenerateColumns="false">
      <HeaderStyle CssClass="top_tab" />
    

    Or in the GridView tag, like this:

    <asp:GridView ID="gwCompanies" runat="server" HeaderStyle-CssClass="top_tab" AutoGenerateColumns="false">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in ASP.Net Gridview properties inside PagerSettings, how can we add new mode named NumericNextPreviousFirstLast
Does someone know how I can export a gridview in ASP.net to Excel?? I
Is it possible to add radio buttons in gridview ? Or can i make
When we add a gridview we can enable selecting a row by checked enable
I need to allow users to add new entries to GridView but at the
I have DropDownList inside GridView. Now I would like to add event handler for
When I add any validators to any template type inside of a gridview it
How can I add an Edit column in this GridView dynamically? I have been
I've got my GridView inside another Panel and I got scrollbars but GridView is
From what I used in Telerik's GridView control, I can dynamically add a column

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.