Click here to Skip to main content
15,887,394 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Stopping resizing of usercontrol and grid cell visibility Pin
Gerry Schmitz23-Sep-15 8:21
mveGerry Schmitz23-Sep-15 8:21 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs23-Sep-15 16:28
Saurabh18cs23-Sep-15 16:28 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Gerry Schmitz24-Sep-15 6:56
mveGerry Schmitz24-Sep-15 6:56 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs24-Sep-15 21:47
Saurabh18cs24-Sep-15 21:47 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Gerry Schmitz24-Sep-15 22:54
mveGerry Schmitz24-Sep-15 22:54 
SuggestionRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun24-Sep-15 7:45
J. Calhoun24-Sep-15 7:45 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs24-Sep-15 21:50
Saurabh18cs24-Sep-15 21:50 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun25-Sep-15 2:14
J. Calhoun25-Sep-15 2:14 
Ok, yes I think I understand a little better now, so you have a 2 x 2 grid, each has a button in it. When one of those buttons is set to collapsed you want the grid space to be released. Here is the solution I have come up with.

1) you only need to do row definitions

C#
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
    <Grid.RowDefinitions>
</Grid>


Next you will want to declare some stack panels


C#
<StackPanel Grid.Row="0">
    <StackPanel Orientation="Horizontal">
        <Button Height="50" Width="100" />
        <Button Height="50" Width="100" />
    /StackPanel>
</StackPanel>


C#
<StackPanel Grid.Row="1">
    <StackPanel Orientation="Horizontal">
        <Button Height="50" Width="100" />
        <Button Height="50" Width="100" />
    /StackPanel>
</StackPanel>


Now you have a button in each quadrant and as you set each visibility to collapsed you will see that the grid space previously held by the button will be released.

You may have to do some sizing with the UserControl or Window that hosts the grid that this is placed in, but the concept should be what you are asking.

Hope this correctly identifies your issue and helps with a resolution!
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs25-Sep-15 20:06
Saurabh18cs25-Sep-15 20:06 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun28-Sep-15 3:06
J. Calhoun28-Sep-15 3:06 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs29-Sep-15 0:13
Saurabh18cs29-Sep-15 0:13 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun29-Sep-15 3:38
J. Calhoun29-Sep-15 3:38 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs29-Sep-15 17:28
Saurabh18cs29-Sep-15 17:28 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun30-Sep-15 3:11
J. Calhoun30-Sep-15 3:11 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs30-Sep-15 22:45
Saurabh18cs30-Sep-15 22:45 
QuestionWPF UI Loading Question Pin
Kevin Marois11-Sep-15 5:50
professionalKevin Marois11-Sep-15 5:50 
AnswerRe: WPF UI Loading Question Pin
Kenneth Haugland12-Sep-15 1:57
mvaKenneth Haugland12-Sep-15 1:57 
AnswerRe: WPF UI Loading Question Pin
Pete O'Hanlon12-Sep-15 11:36
mvePete O'Hanlon12-Sep-15 11:36 
GeneralRe: WPF UI Loading Question Pin
Kevin Marois14-Sep-15 15:27
professionalKevin Marois14-Sep-15 15:27 
GeneralRe: WPF UI Loading Question Pin
Dave Kreskowiak15-Sep-15 3:25
mveDave Kreskowiak15-Sep-15 3:25 
QuestionVerticalAlignment.Bottom Problem Pin
Kevin Marois11-Sep-15 5:36
professionalKevin Marois11-Sep-15 5:36 
AnswerRe: VerticalAlignment.Bottom Problem Pin
Kenneth Haugland20-Sep-15 22:07
mvaKenneth Haugland20-Sep-15 22:07 
SuggestionRe: VerticalAlignment.Bottom Problem Pin
J. Calhoun24-Sep-15 9:22
J. Calhoun24-Sep-15 9:22 
QuestionWPF How To Freeze The UI Pin
Kevin Marois10-Sep-15 5:57
professionalKevin Marois10-Sep-15 5:57 
QuestionSearchTextBox by sean a. hanley Pin
Saurabh18cs9-Sep-15 16:22
Saurabh18cs9-Sep-15 16:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.