Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. GridView columns HeaderText from a function

GridView columns HeaderText from a function

Scheduled Pinned Locked Moved ASP.NET
question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dr_X
    wrote on last edited by
    #1

    The following variations (and more) fail to display correctly. Want to have the HeaderText property in the aspx page obtain a value from the code behind page. Any ideas?

    asp:BoundField DataField="Cargo" HeaderText='<% BL.Translate("Cargos") %>' SortExpression="Cargo"
    asp:BoundField DataField="Cargo" HeaderText='<% =BL.Translate("Cargos") %>' SortExpression="Cargo"
    asp:BoundField DataField="Cargo" HeaderText=<% BL.Translate("Cargos") %> SortExpression="Cargo"

    Thanks, Michael

    I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)

    V 1 Reply Last reply
    0
    • D Dr_X

      The following variations (and more) fail to display correctly. Want to have the HeaderText property in the aspx page obtain a value from the code behind page. Any ideas?

      asp:BoundField DataField="Cargo" HeaderText='<% BL.Translate("Cargos") %>' SortExpression="Cargo"
      asp:BoundField DataField="Cargo" HeaderText='<% =BL.Translate("Cargos") %>' SortExpression="Cargo"
      asp:BoundField DataField="Cargo" HeaderText=<% BL.Translate("Cargos") %> SortExpression="Cargo"

      Thanks, Michael

      I firmly believe that any man's finest hour, the greatest fulfillment of all that he holds dear, is that moment when he has worked his heart out in a good cause and lies exhausted on the field of battle - victorious. Vince Lombardi (1913-1970)

      V Offline
      V Offline
      Venkatesh Mookkan
      wrote on last edited by
      #2

      You cannot use Inline Coding in Server Controls. Use RowDataBound or DataBound Event of the GridView Control to set its HeaderText.

      Regards, Venkatesh Mookkan. Software Engineer, India My: Website | Yahoo Group | Blog Spot

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups