Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8034965
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:10:25+00:00 2026-06-05T02:10:25+00:00

I have a Grid with some rows. The height of the rows are set

  • 0

I have a Grid with some rows. The height of the rows are set relatively to the window size like this:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="0.3*" />
        <RowDefinition Height="0.2*" />
        <RowDefinition Height="0.2*" />
        <RowDefinition Height="0.1*" /> <!-- hide this row -->
        <RowDefinition Height="0.2*" />
    </Grid.RowDefinitions>
</Grid>

Now i want to hide the content of one row based on a binded property. Therefore I set the Visiblity Property of the content object to Collapsed. The Visiblity of the content works fine but the row still needs the original space.

Is there a way to hide the row when Visiblity of the content is collapsed? Note: I don’t want to set the Height in the RowDefinition to Auto because so I can’t set the Height relatively to the Window size and the height of the row gets adjustet to the height of the content inside the row.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T02:10:28+00:00Added an answer on June 5, 2026 at 2:10 am

    You could bind the Height property of the row to the binded property.

    Then you need a converter (implementation of IValueConverter) from typeof(binded property) to System.Windows.GridLength.

    Perhaps something like

    [ValueConversion(typeof(System.Windows.Visibility), typeof(System.Windows.GridLength))]
    public class VisibToHeightConv : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            bool b = (boolean)value;
    
            if (b == true)
                return new System.Windows.GridLength(0, System.Windows.GridUnitType.Star);
            else
                return new System.Windows.GridLength(80, System.Windows.GridUnitType.Star);
        }
    
        public object ConvertBack(object value, Type targetType, object parameter,   System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have some grid that looks like this _ _ _ _
I have some filter and one grid.And grid have some buttons like modify/edit.I am
I have a grid of some width and height, where each cell can be
Some info of the situation: Say I have a grid view of 10 rows
I have a table which displays some grid data for search results...Now the height
This is in SQL Server 2005. I have a varchar column and some rows
I have a gridview that has some 20 columns and 1000 rows. The grid
I have a grid view on a page and the row height can vary.
I have a grid displaying some information and when I select multiple rows and
I have a NxN grid with some values, which change every time step. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.