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. WPF
  4. Is it safe to change datagridcolumn cell style at run time?

Is it safe to change datagridcolumn cell style at run time?

Scheduled Pinned Locked Moved WPF
question
7 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.
  • D Offline
    D Offline
    Dr Hurol Aslan
    wrote on last edited by
    #1

    The question is in the title. I just need to relieve myself of the gnawing worries, that is, until someone answers "No".

    M 1 Reply Last reply
    0
    • D Dr Hurol Aslan

      The question is in the title. I just need to relieve myself of the gnawing worries, that is, until someone answers "No".

      M Offline
      M Offline
      Marco Bertschi
      wrote on last edited by
      #2

      It should be safe because you are only changing the style and do not delete it or anything like that.

      D 1 Reply Last reply
      0
      • M Marco Bertschi

        It should be safe because you are only changing the style and do not delete it or anything like that.

        D Offline
        D Offline
        Dr Hurol Aslan
        wrote on last edited by
        #3

        Thank you, but one more thing: I have come across examples that involve replacing DataGridColumn objects in handlers for AutoGeneratingColumn event. Would you consider that unsafe?

        M M 2 Replies Last reply
        0
        • D Dr Hurol Aslan

          Thank you, but one more thing: I have come across examples that involve replacing DataGridColumn objects in handlers for AutoGeneratingColumn event. Would you consider that unsafe?

          M Offline
          M Offline
          Marco Bertschi
          wrote on last edited by
          #4

          I have no experience with this. But it sounds kinda scry to me :sigh:

          1 Reply Last reply
          0
          • D Dr Hurol Aslan

            Thank you, but one more thing: I have come across examples that involve replacing DataGridColumn objects in handlers for AutoGeneratingColumn event. Would you consider that unsafe?

            M Offline
            M Offline
            Mycroft Holmes
            wrote on last edited by
            #5

            You are trying to replace an Event (AutoGeneratingColumn) with an object? I think you mean and auto generated column with a customised datagridcolumn, therefore replacing one object with the same type of object just custom built. I would think this would be reasonable, be prepared for the column collection to object but I don't see how. I would locate the column in the collection and customise it in place rather than replacing it. Caveat - I have never done this either!

            Never underestimate the power of human stupidity RAH

            D 1 Reply Last reply
            0
            • M Mycroft Holmes

              You are trying to replace an Event (AutoGeneratingColumn) with an object? I think you mean and auto generated column with a customised datagridcolumn, therefore replacing one object with the same type of object just custom built. I would think this would be reasonable, be prepared for the column collection to object but I don't see how. I would locate the column in the collection and customise it in place rather than replacing it. Caveat - I have never done this either!

              Never underestimate the power of human stupidity RAH

              D Offline
              D Offline
              Dr Hurol Aslan
              wrote on last edited by
              #6

              Thank you, too, but I had written "... replacing DataGridColumn objects in handlers for AutoGeneratingColumn event ...". The author of such an example also expressed concerns, like you did.

              M 1 Reply Last reply
              0
              • D Dr Hurol Aslan

                Thank you, too, but I had written "... replacing DataGridColumn objects in handlers for AutoGeneratingColumn event ...". The author of such an example also expressed concerns, like you did.

                M Offline
                M Offline
                Mycroft Holmes
                wrote on last edited by
                #7

                Ah that makes more sense, I would still try and change the existing columns properties rather than replacing it. In one scenario I know the content of the first 4 columns and change the individual formats in the afterautocolumngenerated event (the event name maybe wrong :-O ). The remainder are from a pivot query and are not formatted.

                Never underestimate the power of human stupidity RAH

                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