HyperLinkField in DataGridView

Status
Niet open voor verdere reacties.

Myclos81

Gebruiker
Lid geworden
17 nov 2007
Berichten
157
Dag luitjes,

onderstaande HyperLinkField in mijn datagridview zou ik willen opmaken met een font-color.
Nu via CSS heb ik

Code:
h1
{ 
    color: #e3f0d9; 
}

Maar waar zet ik dan de <h1></h1> tags in mijn HyperLinkField tags ?



Code:
<asp:GridView ID="_dgrCustomer" runat="server" AutoGenerateColumns="False" GridLines="both" Width="100%">
                   <%--<asp:GridView ID="_dgrCustomer" runat="server" AutoGenerateColumns="False" Width="100%" CssClass="GridViewStyle">--%>
                        <Columns>
                            <asp:BoundField HeaderText="Index" DataField="relatie_index" />
                            <asp:BoundField HeaderText="Doss" DataField="firma_dossier" />
                            <%--<asp:BoundField HeaderText="Bedrijf" DataField="firma" />--%>
                            <asp:HyperLinkField HeaderText="Bedrijf" DataTextField ="firma" DataNavigateUrlFields ="firma" 
                                 DataNavigateUrlFormatString ="ContactAdress.aspx?CustomerId=500& Name='blablabla'">
                                 <ControlStyle CssClass="GridViewHyperLink" />
                            </asp:HyperLinkField>
                            

                            <asp:HyperLinkField HeaderText="Naam, Voornaam" DataTextField ="naam_voornaam" DataNavigateUrlFields ="naam_voornaam" 
                                 DataNavigateUrlFormatString ="emrhome.aspx?PatientID={0}& Name='blablabla'">
                                 <ControlStyle CssClass="GridViewHyperLink" />
                            </asp:HyperLinkField>
                           
                           <%--<asp:HyperLinkField HeaderText="Test" DataTextField="firma_dossier" DataNavigateUrlFields="Id" DataNavigateUrlFormatString="~/Templates/View.aspx?id={0}" HeaderStyle-CssClass="columnStyle" ItemStyle-CssClass="columnStyle" >
                                <ControlStyle CssClass="gridlink" />
                            </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" />
                            <%--<asp:TemplateField HeaderText="Tel">
                                <ItemTemplate>
                                    <div style="width: 40px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
                                        <%# Eval("contact_tel") %>
                                    </div>
                                </ItemTemplate>
                            </asp:TemplateField>--%>
                        </Columns> 
                        <FooterStyle cssclass="GridViewFooterStyle" />
                        <RowStyle backcolor="#e3f0d9" forecolor="black" font-size="10pt" />    
                        <SelectedRowStyle cssclass="GridViewSelectedRowStyle" />
                        <PagerStyle cssclass="GridViewPagerStyle" />
                        <AlternatingRowStyle backcolor="#a9d389" forecolor="#48576C" />
                        <HeaderStyle cssclass="GridViewHeaderStyle" />
                        <%--<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />--%>
                        <HeaderStyle backcolor=silver font-bold="True" forecolor="Black" />
                    </asp:GridView>
               </div>
 
Code:
<div>
                   <asp:GridView ID="_dgrCustomer" runat="server" AutoGenerateColumns="False" GridLines="both" Width="100%" CssClass="mGrid">
                   <SelectedRowStyle CssClass="pgr" />
                   <AlternatingRowStyle CssClass="alt" />
                        <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="mGrid.alt"/>
                            </asp:HyperLinkField>
                            <asp:HyperLinkField HeaderText="Naam, Voornaam" DataTextField ="naam_voornaam" DataNavigateUrlFields ="contact_index" 
                                 DataNavigateUrlFormatString ="ContactAdress.aspx?CustomerId={0}&soort=contact">
                                 <ControlStyle CssClass="WhiteLink" />
                            </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> 
                        <RowStyle backcolor="#e3f0d9" forecolor="black" font-size="10pt" />    
                        <AlternatingRowStyle backcolor="#a9d389" forecolor="#48576C" />
                        <FooterStyle backColor="#990000" font-bold="True" forecolor="White" />
                        <HeaderStyle backcolor="Silver" font-bold="True" forecolor="Black" />
                    </asp:GridView>
               </div>

Dit is wat ik nu heb maar de CSS die ik ingevoerd heb wil hij niet doorvoeren.
Iemand enig idee hoe dit komt? Blijkbaar is GridView wel moeilijk aan te passen met CSS ...

Via gewoon gewone opmaak in mijn tags <HeaderStyle backcolor="Silver" font-bold="True" forecolor="Black" /> -> dan gaat het wel.
Maar als ik die wegdoe en CSS instel lukt het niet.
 
Dit is mijn CSS:

.mGrid {
width: 100%;
background-color: black;
margin: 5px 0 10px 0;
border: solid 1px #525252;
border-collapse:collapse;
font: 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; }
 
Hoi Myclos81,
Hoe ziet de html-output van deze <div> er uit, als die uit de server komt?
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan