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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. How to make DataGrid column read only at runtime

How to make DataGrid column read only at runtime

Scheduled Pinned Locked Moved C#
csswpfhelptutorial
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.
  • S Offline
    S Offline
    sumeat
    wrote on last edited by
    #1

    Hi, I need to make a data grid column read only based on the value chosen in another column. I have custom table style for the grid, the column styles are of type DataGridTextBoxcolumn. I made the DataGridTextBoxColumn for the particular column read-only at runtime but that does not work. I would appreciate any help. Thanks

    I A 2 Replies Last reply
    0
    • S sumeat

      Hi, I need to make a data grid column read only based on the value chosen in another column. I have custom table style for the grid, the column styles are of type DataGridTextBoxcolumn. I made the DataGridTextBoxColumn for the particular column read-only at runtime but that does not work. I would appreciate any help. Thanks

      I Offline
      I Offline
      Ista
      wrote on last edited by
      #2

      DataGridTextBoxColumn dgt = new DataGridTextBoxColumn(); dgt.ReadOnly = true; I'm not an expert yet, but I play one at work. Yeah and here too.

      S 1 Reply Last reply
      0
      • S sumeat

        Hi, I need to make a data grid column read only based on the value chosen in another column. I have custom table style for the grid, the column styles are of type DataGridTextBoxcolumn. I made the DataGridTextBoxColumn for the particular column read-only at runtime but that does not work. I would appreciate any help. Thanks

        A Offline
        A Offline
        A Wegierski
        wrote on last edited by
        #3

        As usual. Create an inherited DataGridTextBoxColumn and override Edit method to call base.Edit(...) only if Your another column has appropriate values. Hi, AW

        1 Reply Last reply
        0
        • I Ista

          DataGridTextBoxColumn dgt = new DataGridTextBoxColumn(); dgt.ReadOnly = true; I'm not an expert yet, but I play one at work. Yeah and here too.

          S Offline
          S Offline
          sumeat
          wrote on last edited by
          #4

          Thanks it worked! Earlier I intended to do the same but mistakenly instead of setting the readonly property of the textboxColumn I was setting the readonly property of the textbox in the textboxColumn. Suhas

          I 1 Reply Last reply
          0
          • S sumeat

            Thanks it worked! Earlier I intended to do the same but mistakenly instead of setting the readonly property of the textboxColumn I was setting the readonly property of the textbox in the textboxColumn. Suhas

            I Offline
            I Offline
            Ista
            wrote on last edited by
            #5

            LOL:laugh: I'm not an expert yet, but I play one at work. Yeah and here too.

            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