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. WCF and WF
  4. Collapsing cell in uniform grid

Collapsing cell in uniform grid

Scheduled Pinned Locked Moved WCF and WF
csswpfquestion
3 Posts 2 Posters 7 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.
  • M Offline
    M Offline
    MBursill
    wrote on last edited by
    #1

    I have a simple four column uniform grid:

    <UniformGrid Columns="4">

    <Button>Button 1</Button>
    <Button Visibility="Collapsed">Button 2</Button>
    <Button>Button 3</Button>
    <Button>Button 4</Button>
    

    </UniformGrid>

    I want to distribute the space of the second column when the element is collapsed, essentially making it a three column grid. Is there an all XAML solution to this? I've also tried using a 4 column Grid (not uniform) but set each column's width to *, simulating a uniform grid. Auto sized columns wont work for what I need. Thanks. -Mike.

    L 1 Reply Last reply
    0
    • M MBursill

      I have a simple four column uniform grid:

      <UniformGrid Columns="4">

      <Button>Button 1</Button>
      <Button Visibility="Collapsed">Button 2</Button>
      <Button>Button 3</Button>
      <Button>Button 4</Button>
      

      </UniformGrid>

      I want to distribute the space of the second column when the element is collapsed, essentially making it a three column grid. Is there an all XAML solution to this? I've also tried using a 4 column Grid (not uniform) but set each column's width to *, simulating a uniform grid. Auto sized columns wont work for what I need. Thanks. -Mike.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      In the code that sets this, have you tried setting the columns to 3?

      Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | XAML Power Toys Home Page

      Just a grain of sand on the worlds beaches.

      M 1 Reply Last reply
      0
      • L Lost User

        In the code that sets this, have you tried setting the columns to 3?

        Cheers, Karl » CodeProject 2008 MVP My Blog | Mole's Home Page | XAML Power Toys Home Page

        Just a grain of sand on the worlds beaches.

        M Offline
        M Offline
        MBursill
        wrote on last edited by
        #3

        Thanks for the reply. Setting the columns to 3 works great when I have one of the 4 elements collapsed. The idea was to avoid having to set the columns property dynamically, and have an all XAML solution. In other words, I want the grid to only count columns where the containing element is not collapsed. I was able to do just that by using reflector to dig into the UnformGrid, copy out some of the code, and extend it a bit. If anyone is interested in the code, I'll post it. -Mike.

        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