GridView and PagerStyle problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kamen

    GridView and PagerStyle problem

    Hello there,

    I try to define the properties font-size and font-bold of the pager of a
    gridview using the pagerstyle, but the settings are not appleyd at run time.

    What could be the reason for this?
    I am very appreciated for your help.
    Kamen

    Here is the ASPX-code:

    <asp:GridView ID="gvMailingPe rsons" style="Z-INDEX: 106;
    LEFT: 0px; POSITION: absolute; TOP: 0px" runat="server" BorderColor="#9 99999"
    BorderStyle="No tSet" BackColor="Whit e" CellPadding="3" GridLines="Vert ical"
    AutoGenerateCol umns="False" DataSource="<%# DS_MailingPerso ns %>"
    Height="8px" Width="990px" CssClass="grid" AllowSorting="t rue"
    AllowPaging="tr ue" PageSize="50" PagerSettings-Position=Bottom
    DataKeyNames="K ontaktNr">
    <SelectedRowSty le Font-Bold="True"></SelectedRowStyl e>
    <AlternatingRow Style
    CssClass="grid_ AlternatingItem "></AlternatingRowS tyle>
    <RowStyle CssClass="grid_ Item"></RowStyle>
    <HeaderStyle Wrap="False" ForeColor="Whit e" BorderStyle="No ne"
    CssClass="grid_ Header"></HeaderStyle>
    <Columns>
    <asp:BoundFie ld DataField="Kont aktNr" SortExpression= "KontaktNr"
    Visible="False" ></asp:BoundField>
    <asp:TemplateFi eld HeaderText="Sel ected">
    <ItemTemplate >
    <asp:CheckBox id="cbSelectedR ecipient" runat="server"
    Checked="False" ></asp:CheckBox>
    </ItemTemplate>
    </asp:TemplateFie ld>
    <asp:ButtonFiel d CommandName="eM ail" HeaderText="E-Mail"
    SortExpression= "EMail" DataTextField=" EMail"></asp:ButtonField >
    </Columns>
    <PagerStyle ForeColor="Whit e" Font-Bold=true Font-Size=11px
    Font-Names=Verdana></PagerStyle>
    <PagerSetting s
    FirstPageImageU rl="~/Res/PrevYear.ico" FirstPageText=" First"
    LastPageImageUr l="~/Res/NextYear.ico"
    LastPageText="L ast" Mode="NumericFi rstLast" />
    </asp:GridView>

  • Winista

    #2
    Re: GridView and PagerStyle problem

    This should work fine.
    Look at HTML source of your page after it is rendered and see if style is
    applied or not.

    "Kamen" <Kamen@discussi ons.microsoft.c om> wrote in message
    news:059B3740-AD80-44D1-9F0D-B5AF553BF923@mi crosoft.com...[color=blue]
    > Hello there,
    >
    > I try to define the properties font-size and font-bold of the pager of a
    > gridview using the pagerstyle, but the settings are not appleyd at run
    > time.
    >
    > What could be the reason for this?
    > I am very appreciated for your help.
    > Kamen
    >
    > Here is the ASPX-code:
    >
    > <asp:GridView ID="gvMailingPe rsons" style="Z-INDEX:
    > 106;
    > LEFT: 0px; POSITION: absolute; TOP: 0px" runat="server"
    > BorderColor="#9 99999"
    > BorderStyle="No tSet" BackColor="Whit e" CellPadding="3"
    > GridLines="Vert ical"
    > AutoGenerateCol umns="False" DataSource="<%# DS_MailingPerso ns %>"
    > Height="8px" Width="990px" CssClass="grid" AllowSorting="t rue"
    > AllowPaging="tr ue" PageSize="50" PagerSettings-Position=Bottom
    > DataKeyNames="K ontaktNr">
    > <SelectedRowSty le Font-Bold="True"></SelectedRowStyl e>
    > <AlternatingRow Style
    > CssClass="grid_ AlternatingItem "></AlternatingRowS tyle>
    > <RowStyle CssClass="grid_ Item"></RowStyle>
    > <HeaderStyle Wrap="False" ForeColor="Whit e" BorderStyle="No ne"
    > CssClass="grid_ Header"></HeaderStyle>
    > <Columns>
    > <asp:BoundFie ld DataField="Kont aktNr" SortExpression= "KontaktNr"
    > Visible="False" ></asp:BoundField>
    > <asp:TemplateFi eld HeaderText="Sel ected">
    > <ItemTemplate >
    > <asp:CheckBox id="cbSelectedR ecipient" runat="server"
    > Checked="False" ></asp:CheckBox>
    > </ItemTemplate>
    > </asp:TemplateFie ld>
    > <asp:ButtonFiel d CommandName="eM ail" HeaderText="E-Mail"
    > SortExpression= "EMail" DataTextField=" EMail"></asp:ButtonField >
    > </Columns>
    > <PagerStyle ForeColor="Whit e" Font-Bold=true Font-Size=11px
    > Font-Names=Verdana></PagerStyle>
    > <PagerSetting s
    > FirstPageImageU rl="~/Res/PrevYear.ico" FirstPageText=" First"
    > LastPageImageUr l="~/Res/NextYear.ico"
    > LastPageText="L ast" Mode="NumericFi rstLast" />
    > </asp:GridView>
    >[/color]


    Comment

    • Kamen

      #3
      Re: GridView and PagerStyle problem

      Hi Winista,

      Thank you for your response!
      After the page is rendered is the style applied in the HTML source, but not
      visible in the browser (IE 6.0).
      Only the properties "color:Whit e" and "font-family:Verdana" take effect.

      Should I take care of speciality settings of the browser?

      Here is the HTML-code after the page is rendered :

      <div>
      <table title="752 Datensätze" class="grid" cellspacing="0" cellpadding="3"
      rules="cols" bordercolor="#9 99999" border="1" id="gvMailingPe rsons"
      style="backgrou nd-color:White;bor der-color:#999999;h eight:8px;width :990px;border-collapse:collap se;Z-INDEX: 106; LEFT: 8px; POSITION: absolute; TOP: 329px">
      <tr class="grid_Hea der" nowrap="nowrap"
      style="color:Wh ite;border-style:None;">
      <th scope="col">Aus gewählt</th><th scope="col"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Sort$Reakt ion')"
      style="color:Wh ite;">Status</a></th><th scope="col"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Sort$Konta ktPerson')"
      style="color:Wh ite;">Nachname</a></th><th scope="col"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Sort$Vorna me')"
      style="color:Wh ite;">Vorname</a></th><th scope="col"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Sort$Firme nname1')"
      style="color:Wh ite;">Medium 1</a></th><th scope="col"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Sort$EMail ')"
      style="color:Wh ite;">E-Mail</a></th><th scope="col"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Sort$Telef ax')"
      style="color:Wh ite;">Telefax</a></th><th scope="col"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Sort$Versa ndart')"
      style="color:Wh ite;">Versandar t</a></th><th scope="col"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Sort$Adres sAnrede')"
      style="color:Wh ite;">Adressanr ede</a></th><th scope="col"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Sort$PLZ') "
      style="color:Wh ite;">PLZ</a></th><th scope="col"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Sort$Ort') "
      style="color:Wh ite;">Ort</a></th><th scope="col"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Sort$Stras se')"
      style="color:Wh ite;">Strasse</a></th>
      </tr><tr class="grid_Ite m">
      <td>

      <input id="gvMailingPe rsons__ctl2_cbS electedRecipien t"
      type="checkbox" name="gvMailing Persons:_ctl2:c bSelectedRecipi ent"
      /></td><td> </td><td style="color:#0 03399;"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Details$0' )"
      style="color:#0 03399;">Zingraf f</a></td><td>Matthias </td><td
      style="color:#0 03399;"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Details$0' )"
      style="color:#0 03399;">Matthia s Zingraff</a></td><td
      style="color:#0 03399;"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','eMail$0')"
      style="color:#0 03399;"></a></td><td>05235/99823</td><td> </td><td>Herrn
      Matthias Zingraff</td><td>32825</td><td>Blomberg </td><td>Kirchhof straße 1</td>
      </tr><tr class="grid_Alt ernatingItem">
      <td>

      <input id="gvMailingPe rsons__ctl3_cbS electedRecipien t"
      type="checkbox" name="gvMailing Persons:_ctl3:c bSelectedRecipi ent"
      /></td><td> </td><td style="color:#0 03399;"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Details$1' )"
      style="color:#0 03399;">Zobel</a></td><td> </td><td style="color:#0 03399;"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Details$1' )"
      style="color:#0 03399;">Lions District 111 WL</a></td><td
      style="color:#0 03399;"><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','eMail$1')"
      style="color:#0 03399;"></a></td><td> </td><td> </td><td>Herrn
      Zobel</td><td>33334</td><td>Gütersl oh</td><td>Herzebro ckerstr. 225</td>
      </tr><tr
      style="color:Wh ite;font-family:Verdana; font-size:11px;font-weight:bold;">
      <td colspan="12"><t able border="0">
      <tr>
      <td><input type="image" src="../Res/PrevYear.ico" alt="First"
      border="0" onclick="javasc ript:__doPostBa ck('gvMailingPe rsons','Page$Fi rst')"
      language="javas cript" /></td><td><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Page$6')"
      style="color:Wh ite;">...</a></td><td><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Page$7')"
      style="color:Wh ite;">7</a></td><td><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Page$8')"
      style="color:Wh ite;">8</a></td><td><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Page$9')"
      style="color:Wh ite;">9</a></td><td><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Page$10')"
      style="color:Wh ite;">10</a></td><td><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Page$11')"
      style="color:Wh ite;">11</a></td><td><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Page$12')"
      style="color:Wh ite;">12</a></td><td><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Page$13')"
      style="color:Wh ite;">13</a></td><td><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Page$14')"
      style="color:Wh ite;">14</a></td><td><a
      href="javascrip t:__doPostBack( 'gvMailingPerso ns','Page$15')"
      style="color:Wh ite;">15</a></td><td><span>16 </span></td>
      </tr>
      </table></td>
      </tr>
      </table>
      </div>



      "Winista" wrote:
      [color=blue]
      > This should work fine.
      > Look at HTML source of your page after it is rendered and see if style is
      > applied or not.
      >
      > "Kamen" <Kamen@discussi ons.microsoft.c om> wrote in message
      > news:059B3740-AD80-44D1-9F0D-B5AF553BF923@mi crosoft.com...[color=green]
      > > Hello there,
      > >
      > > I try to define the properties font-size and font-bold of the pager of a
      > > gridview using the pagerstyle, but the settings are not appleyd at run
      > > time.
      > >
      > > What could be the reason for this?
      > > I am very appreciated for your help.
      > > Kamen
      > >
      > > Here is the ASPX-code:
      > >
      > > <asp:GridView ID="gvMailingPe rsons" style="Z-INDEX:
      > > 106;
      > > LEFT: 0px; POSITION: absolute; TOP: 0px" runat="server"
      > > BorderColor="#9 99999"
      > > BorderStyle="No tSet" BackColor="Whit e" CellPadding="3"
      > > GridLines="Vert ical"
      > > AutoGenerateCol umns="False" DataSource="<%# DS_MailingPerso ns %>"
      > > Height="8px" Width="990px" CssClass="grid" AllowSorting="t rue"
      > > AllowPaging="tr ue" PageSize="50" PagerSettings-Position=Bottom
      > > DataKeyNames="K ontaktNr">
      > > <SelectedRowSty le Font-Bold="True"></SelectedRowStyl e>
      > > <AlternatingRow Style
      > > CssClass="grid_ AlternatingItem "></AlternatingRowS tyle>
      > > <RowStyle CssClass="grid_ Item"></RowStyle>
      > > <HeaderStyle Wrap="False" ForeColor="Whit e" BorderStyle="No ne"
      > > CssClass="grid_ Header"></HeaderStyle>
      > > <Columns>
      > > <asp:BoundFie ld DataField="Kont aktNr" SortExpression= "KontaktNr"
      > > Visible="False" ></asp:BoundField>
      > > <asp:TemplateFi eld HeaderText="Sel ected">
      > > <ItemTemplate >
      > > <asp:CheckBox id="cbSelectedR ecipient" runat="server"
      > > Checked="False" ></asp:CheckBox>
      > > </ItemTemplate>
      > > </asp:TemplateFie ld>
      > > <asp:ButtonFiel d CommandName="eM ail" HeaderText="E-Mail"
      > > SortExpression= "EMail" DataTextField=" EMail"></asp:ButtonField >
      > > </Columns>
      > > <PagerStyle ForeColor="Whit e" Font-Bold=true Font-Size=11px
      > > Font-Names=Verdana></PagerStyle>
      > > <PagerSetting s
      > > FirstPageImageU rl="~/Res/PrevYear.ico" FirstPageText=" First"
      > > LastPageImageUr l="~/Res/NextYear.ico"
      > > LastPageText="L ast" Mode="NumericFi rstLast" />
      > > </asp:GridView>
      > >[/color]
      >
      >
      >[/color]

      Comment

      Working...