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. regd Datagrid

regd Datagrid

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

    Hi, I want to color a column in a datagrid . How do I do this? Karteek

    H J 2 Replies Last reply
    0
    • K karteek

      Hi, I want to color a column in a datagrid . How do I do this? Karteek

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      I told you how the last time you asked this: by extending the DataGridColumnStyle with your own class nad overriding the necessary properties and methods. You must then define your DataGridTableStyles and DataGridColumnStyles explicitly. See DataGrid.TableStyles in the .NET Framework SDK documentation for more information.

      Microsoft MVP, Visual C# My Articles

      1 Reply Last reply
      0
      • K karteek

        Hi, I want to color a column in a datagrid . How do I do this? Karteek

        J Offline
        J Offline
        Jay Shankar
        wrote on last edited by
        #3

        the following article in CP, will guide you in achieving the goal Changing the background color of cells in a DataGrid[^] Please revert back whether you could achieve the functionality or not? Regards, Jay

        K 1 Reply Last reply
        0
        • J Jay Shankar

          the following article in CP, will guide you in achieving the goal Changing the background color of cells in a DataGrid[^] Please revert back whether you could achieve the functionality or not? Regards, Jay

          K Offline
          K Offline
          karteek
          wrote on last edited by
          #4

          Hi, I do not know the number of coulmns in the table or name of the columns. I am dynamically reading the table data from the database. In that case how can I set the mappingname,column name etc... Is there a way to get these while reading data from database. KArteek

          J 1 Reply Last reply
          0
          • K karteek

            Hi, I do not know the number of coulmns in the table or name of the columns. I am dynamically reading the table data from the database. In that case how can I set the mappingname,column name etc... Is there a way to get these while reading data from database. KArteek

            J Offline
            J Offline
            Jay Shankar
            wrote on last edited by
            #5

            DataSetObject.Tables[0].Columns gives you the collection of the columns, you can set mapping name to any string value (like someName+ i // i is the column number). I think u need to solve the problem logically (I guess, not sure)

            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