« Gepost op: 23 maart 2012, 11:15:01 »
OK, ben nu al een tijdje aan het zoeken om mijn GridView te koppelen aan mijn CSS.
Alles wat ik gevonden heb op internet doet het niet. Wil daarom iemand even mijn code bekijken?
ASP.NET:
...
<head>
<title>Zoekscherm</title>
<link href="CSS/default.css" rel="stylesheet" type="text/css" />
</head>
...
<div>
<asp:GridView ID="_dgrCustomer" runat="server" AutoGenerateColumns="False" GridLines="both" Width="100%" CssClass="gridview">
<Columns>
<asp:BoundField HeaderText="Index" DataField="relatie_index" />
<asp:BoundField HeaderText="Doss" DataField="firma_dossier" />
<asp:HyperLinkField HeaderText="Bedrijf" DataTextField ="firma" DataNavigateUrlFields ="firma_index"
DataNavigateUrlFormatString ="ContactAdress.aspx?CustomerId={0}&soort=firma">
<ControlStyle CssClass="alt"/>
</asp:HyperLinkField>
<asp:HyperLinkField HeaderText="Naam, Voornaam" DataTextField ="naam_voornaam" DataNavigateUrlFields ="contact_index"
DataNavigateUrlFormatString ="ContactAdress.aspx?CustomerId={0}&soort=contact">
<ControlStyle CssClass="pgr" />
</asp:HyperLinkField>
<asp:BoundField HeaderText="Bedrijf tel" DataField="firma_tel" />
<asp:BoundField HeaderText="Bedrijf fax" DataField="firma_fax" />
<asp:BoundField HeaderText="Bedrijf gsm" DataField="firma_gsm" />
<asp:BoundField HeaderText="Contact tel" DataField="contact_tel" />
<asp:BoundField HeaderText="Contact fax" DataField="contact_fax" />
<asp:BoundField HeaderText="Contact gsm" DataField="contact_gsm" />
<asp:BoundField HeaderText="Cat" DataField="cat" />
</Columns>
</asp:GridView>
</div>
Dit is mijn CSS:
.gridview
{
font-size: 20;
}
.gridview tr
{
font-size: x-large;
}
.mGrid {
width: 100%;
background-color: black;
margin: 5px 0 10px 0;
border: solid 1px #525252;
border-collapse:collapse;
font: italic bold normal small/1.4em Verdana, sans-serif;
}
.mGrid td {
padding: 2px;
border: solid 1px #c1c1c1;
color: #717171;
}
.mGrid th {
padding: 4px 2px;
color: #fff;
background: #424242 url(grd_head.png) repeat-x top;
border-left: solid 1px #525252;
font-size: 0.9em;
}
.mGrid .alt { background: black url(grd_alt.png) repeat-x top; }
.mGrid .pgr { background: #424242 url(grd_pgr.png) repeat-x top; }
.mGrid .pgr table { margin: 5px 0; }
.mGrid .pgr td {
border-width: 0;
padding: 0 6px;
border-left: solid 1px #666;
font-weight: bold;
color: #fff;
line-height: 12px;
}
.mGrid .pgr a { color: #666; text-decoration: none; }
.mGrid .pgr a:hover { color: #000; text-decoration: none; }
Niks van de opmaak komt er door en weet dus echt niet hoe het komt
Gelogd
P4VT8+ , GeForce 6200, Windows XP Prof SP2, Intel(R) Pentium(R) 4 CPU 2.80GHz, 768 MB RAM, HDD:80 + 80 GB, NTFS, telenet, AVG antivirus, Internet Explorer 6.0, Outlook Express