Click here to Skip to main content
12,295,252 members (55,300 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#3.0 C# ASP.NET .NET .NET4
I have created one grid view.following is the code
<asp:GridView ID="GridView1" runat="server" EnableModelValidation="True"
                ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" CssClass="mGrid1"
                <AlternatingRowStyle BackColor="Silver" ForeColor="#284775" />
                    <asp:TemplateField HeaderText="Select">
                            <asp:CheckBox ID="Mycheck" runat="server" />
                        <HeaderStyle BorderColor="White" BorderStyle="Solid" BorderWidth="2px" 
                            CssClass="bg" />
                    <asp:TemplateField HeaderText="ContactID" Visible="False">
                            <asp:Label ID="LblContactID" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ContactID")%>'></asp:Label>
                    <asp:TemplateField HeaderText="Name">
                            <asp:Label ID="LblContactName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "FirstName")%>'>
and took one stlesheet grid.css

    font-family: tahoma;
.mGrid1 td   /* this applies to the Gridviews Data fileds */
    padding: 1px;
    width: 3%;
    border-collapse: collapse;
.mGrid1 th   /* this applies to the Gridviews Headers */
     padding: 0px 0px;
     border-width: 1px;
    background: #74ABD4;

now what i want first column first row header "select" should have less width as compared to other .i am unable to achieve this pls tell......
Posted 10-Jan-13 23:36pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

i am getting my outlay correct ...what i was missing that i had a css class in master page which was overlapped by current tags

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 14 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100