Datagrid - Linefeed in header text

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

    Datagrid - Linefeed in header text

    How can I put a linefeed in some header text (I am using the Datagrid
    control and editing the header properties for a field)?

    Average Sales Average Returns Average Sales Average
    Returns
    (Last 30 Days) (Last 6 Months)



  • Jialiang Ge [MSFT]

    #2
    Re: Datagrid - Linefeed in header text

    Hello Mark

    Template fields do not have the HtmlEncode property. In fact, template
    fields do not encode header text, thus we can simply write it as this:

    <asp:GridView ID="GridView1" runat="server"
    AutoGenerateCol umns="false">
    <Columns>
    <asp:BoundFie ld HeaderText="lin e1<br>line2"
    HtmlEncode="fal se" />
    <asp:TemplateFi eld HeaderText="lin e3<br>line4">
    </asp:TemplateFie ld>
    </Columns>
    </asp:GridView>

    If you have any other concerns or questions, please don't hesitate to let
    me know.

    Regards,
    Jialiang Ge (jialge@online. microsoft.com, remove 'online.')
    Microsoft Online Community Support

    =============== =============== =============== ====
    Delighting our customers is our #1 priority. We welcome your comments and
    suggestions about how we can improve the support we provide to you. Please
    feel free to let my manager know what you think of the level of service
    provided. You can send feedback directly to my manager at:
    msdnmg@microsof t.com.

    This posting is provided "AS IS" with no warranties, and confers no rights.
    =============== =============== =============== ====

    Comment

    • Mark B

      #3
      Re: Datagrid - Linefeed in header text

      Thanks.

      "Jialiang Ge [MSFT]" <jialge@online. microsoft.comwr ote in message
      news:0$3H$zgxIH A.4564@TK2MSFTN GHUB02.phx.gbl. ..
      Hello Mark
      >
      Template fields do not have the HtmlEncode property. In fact, template
      fields do not encode header text, thus we can simply write it as this:
      >
      <asp:GridView ID="GridView1" runat="server"
      AutoGenerateCol umns="false">
      <Columns>
      <asp:BoundFie ld HeaderText="lin e1<br>line2"
      HtmlEncode="fal se" />
      <asp:TemplateFi eld HeaderText="lin e3<br>line4">
      </asp:TemplateFie ld>
      </Columns>
      </asp:GridView>
      >
      If you have any other concerns or questions, please don't hesitate to let
      me know.
      >
      Regards,
      Jialiang Ge (jialge@online. microsoft.com, remove 'online.')
      Microsoft Online Community Support
      >
      =============== =============== =============== ====
      Delighting our customers is our #1 priority. We welcome your comments and
      suggestions about how we can improve the support we provide to you. Please
      feel free to let my manager know what you think of the level of service
      provided. You can send feedback directly to my manager at:
      msdnmg@microsof t.com.
      >
      This posting is provided "AS IS" with no warranties, and confers no
      rights.
      =============== =============== =============== ====
      >

      Comment

      Working...