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. DataGrid Column Name

DataGrid Column Name

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasehelpquestion
4 Posts 3 Posters 1 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.
  • T Offline
    T Offline
    Taurian110
    wrote on last edited by
    #1

    I am working with datagrid in ASP.NET application. I want to name a column Product but since this column is named ProductName in DataBase, I am not able to change the name in DataGrid Header. I found a work arround to it by using "as Product" in select statement but is there a way to change the Header Text of a datagrid programatically insted of changing the slect statement? I sure would appreciate your help. Thanks.

    B M 2 Replies Last reply
    0
    • T Taurian110

      I am working with datagrid in ASP.NET application. I want to name a column Product but since this column is named ProductName in DataBase, I am not able to change the name in DataGrid Header. I found a work arround to it by using "as Product" in select statement but is there a way to change the Header Text of a datagrid programatically insted of changing the slect statement? I sure would appreciate your help. Thanks.

      B Offline
      B Offline
      Blue_Skye
      wrote on last edited by
      #2

      Try it in Columns Property. Sincerely! BS

      1 Reply Last reply
      0
      • T Taurian110

        I am working with datagrid in ASP.NET application. I want to name a column Product but since this column is named ProductName in DataBase, I am not able to change the name in DataGrid Header. I found a work arround to it by using "as Product" in select statement but is there a way to change the Header Text of a datagrid programatically insted of changing the slect statement? I sure would appreciate your help. Thanks.

        M Offline
        M Offline
        minhpc_bk
        wrote on last edited by
        #3

        Hi there, Every column in the DataGrid control has the HeaderText[^] property which allows you to set the header text for the column. You can set the header text in the Properties Windows, Html editor or in code.

        T 1 Reply Last reply
        0
        • M minhpc_bk

          Hi there, Every column in the DataGrid control has the HeaderText[^] property which allows you to set the header text for the column. You can set the header text in the Properties Windows, Html editor or in code.

          T Offline
          T Offline
          Taurian110
          wrote on last edited by
          #4

          Thank you very much!

          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