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. General Programming
  3. C#
  4. What property controls the "format" of DataTable columns?

What property controls the "format" of DataTable columns?

Scheduled Pinned Locked Moved C#
question
3 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.
  • J Offline
    J Offline
    JoeRip
    wrote on last edited by
    #1

    I have a DataTable (dt) with a DataColumn (dc) whose Datatype is System.Int64. I want this column to display the 64 bit Int in Hexadecimal format, as if the number had been converted like Int64Data.ToString("X"). What property of a column controls this display? There's no "format" property for a column, and "Expression" appears to be for aggregation. It's important that the column datatype remain INT64 (and not string), or I would just do the formatting conversion myself. Can somebody point me to the correct method for setting the column display formatting? Thanks.

    J 1 Reply Last reply
    0
    • J JoeRip

      I have a DataTable (dt) with a DataColumn (dc) whose Datatype is System.Int64. I want this column to display the 64 bit Int in Hexadecimal format, as if the number had been converted like Int64Data.ToString("X"). What property of a column controls this display? There's no "format" property for a column, and "Expression" appears to be for aggregation. It's important that the column datatype remain INT64 (and not string), or I would just do the formatting conversion myself. Can somebody point me to the correct method for setting the column display formatting? Thanks.

      J Offline
      J Offline
      JoeRip
      wrote on last edited by
      #2

      Doh. Of course. You don't format the display of a DataTable DataColumn, because it's never displayed. You format the display of the column in the DataGridView, in which the DataTable data is displayed. Man, you don't do any table stuff for a year, and you forget everything.

      L 1 Reply Last reply
      0
      • J JoeRip

        Doh. Of course. You don't format the display of a DataTable DataColumn, because it's never displayed. You format the display of the column in the DataGridView, in which the DataTable data is displayed. Man, you don't do any table stuff for a year, and you forget everything.

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        Hehe, it happens :)

        xacc.ide - now with TabsToSpaces support
        IronScheme - 1.0 alpha 4a out now (29 May 2008)

        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