C# Desktop-App: how to applly color for datatable cells.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nirmalsingh
    New Member
    • Sep 2006
    • 218

    C# Desktop-App: how to applly color for datatable cells.

    hai all,
    i want to set color for datatable cells.and assign it to dataset,and to datagrid view. my doubt is , how to apply color for the datatable cells.
    thanx in advance
    with Cheers
    Nirmal
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Have you tried using dhtml, referencing css through JS? HTH.

    Comment

    • Lopy
      New Member
      • Dec 2007
      • 8

      #3
      Is it possible use JS in .Net? in ASP it is, but in .Net?

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by Lopy
        Is it possible use JS in .Net? in ASP it is, but in .Net?
        You have a point Lopy...I don't think you can use JS in a desktop application.

        Check out this article: Cell Styles in the Windows Forum DataGridView Control.

        -Frinny

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          DataGridViews support colorization of their contents (I am fairly sure).

          What you could do is have a few extra columns in your DataTable (enough to define all your design colors/whatever) amd have a function that will zip through it and apply it to the DataGridView. Then you can just set those columns to be invisible so they aren't displayed in the DataGridView?
          Last edited by Plater; Dec 21 '07, 03:06 PM. Reason: changed colorization to a link

          Comment

          • Frinavale
            Recognized Expert Expert
            • Oct 2006
            • 9749

            #6
            Originally posted by Plater
            DataGridViews support colorization of their contents (I am fairly sure).
            The word "colorizati on" just doesn't look right...I'd say "colourization" ...but even that doesn't look right...

            Originally posted by Plater
            What you could do is have a few extra columns in your DataTable (enough to define all your design colors/whatever) amd have a function that will zip through it and apply it to the DataGridView. Then you can just set those columns to be invisible so they aren't displayed in the DataGridView?
            Nice recommendation. ..I use this technique often.

            -Frinny

            Comment

            Working...