GridView Border color Problem ? [Resolved]

Posted by Akiii under Regular Expressions on 5/11/2011 | Points: 10 | Views : 10626 | Status : [Member] | Replies : 4
Hi,
I have a Gridview and the data is binded from the database.
I have used css sttlesheet to decorate by gridview.
The gridview contains a header and a row-wise body section....
The header has a different css and the row-wise body altogether has a different css....

I have attached the snapshot for your perusal.
Now, my problem is that when i give the color in header, and the whole border of the header including the text gets the color.
I want to give separate color for the border and the text in the header, and i cant do that !

.gridMenWomen {
font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
font-size : 12px;
font-weight:bold;
border : 1px solid #000;
color: #FFFFFF;
}

.gridMenWomen_Header {
font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
font-size : 12px;
font-weight:bold;
background-color:#b6b7bc;
color : #FFFFFF;
}

.gridMenWomen_RowStyle {
font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
font-size : 10px;
font-weight:bold;
background-color:#F7F6F3;
color : #333333;
border : 1px solid #FFFFFF;
}


Please help me regarding this and if you need any more information, let me know.

Thanks and Regards
Akiii




Responses

Posted by: Ndebata on: 5/11/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi

Try to use color for text color and border to set border details, Please take a look at the bellow

testGrid {
background-color: #fff;
margin: 5px 0 10px 0;
border: solid 1px #525252;
border-collapse:collapse;
}
.testGrid td {
padding: 2px;
border: solid 1px green;
color: #717171;
}
.testGrid th {
padding: 4px 2px;
color: Lime;

border: solid 2px blue;

font-size: 0.9em;
}

The above set the font color of header to lime and that of border to blue.
* Please change as per your requirement.

Thanks,
Debata

Akiii, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 5/11/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi

Use AutoGenerateColumns="false" property for your gridview as i could see that you are adding <columns></columns>
Thanks,
Debata

Akiii, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akiii on: 5/11/2011 [Member] Bronze | Points: 25

Up
0
Down
hi ndebata....

thank you for ur help....it worked......

i have one more problem......
Suppose i take a datagrid in which i want to name my columns.....then if i do that it is repeating the column twice....means....the column name which i have give and the name of the column from the database .....why is that ?

I am pasting the code here -

<asp:GridView ID="GridView1" runat="server" Height="292px" Width="500px" 

BorderWidth="0px" GridLines="None">
<Columns>
<asp:BoundField DataField="empid" HeaderText="empid" />
<asp:BoundField DataField="empname" HeaderText="empname" />
</Columns>
</asp:GridView>


Regards
Akiii

Akiii, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akiii on: 5/12/2011 [Member] Bronze | Points: 25

Up
0
Down
@ndebata...

Thank you very much the help.....

I mark ur answer as the correct one.........

Thanks and Regards
Akiii

Akiii, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response