Hide grid row in WPF

Row does not have a Visibility property, so as others have said, you need to set the Height. Another option is to use a converter, in case you need this functionality in many views: [ValueConversion(typeof(bool), typeof(GridLength))] public class BoolToGridRowHeightConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return ((bool)value … Read more

Finding neighbor cells in a grid with the same value. Ideas how to improve this function?

Here’s an approach that involves less copying and pasting — hopefully it gives you some idea of how to break things down into the smallest number of the most reusable pieces possible. 🙂 The general idea here is to come up with a way of expressing the concept of scanning a line across the board … Read more

Bootstrap Grid System new line does not look nice

This is due to varying column height. You need a “clearfix” reset every 3 columns to force even wrapping. One way is to use the approach recommended by Bootstrap, or in this specific case you can use a simple CSS clearfix like this.. @media (min-width:992px) { .auto-clear .col-md-4:nth-child(3n+1){clear:left;} } Demo: http://codeply.com/go/mONLiFj30T For other “clearfix” scenarios … Read more

How do I databind a ColumnDefinition’s Width or RowDefinition’s Height?

Create a IValueConverter as follows: public class GridLengthConverter : IValueConverter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { double val = (double)value; GridLength gridLength = new GridLength(val); return gridLength; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { GridLength val = (GridLength)value; return val.Value; } } You can … Read more

How to make CSS Grid items take up remaining space?

Adding grid-template-rows: 1fr min-content; to your .grid will get you exactly what you’re after :). .grid { display: grid; grid-template-columns: 1fr 3fr; grid-template-rows: 1fr min-content; grid-template-areas: “one two” “one three” } .one { background: red; grid-area: one; padding: 50px 0; } .two { background: green; grid-area: two; } .three { background: blue; grid-area: three; } … Read more

Nested rows with bootstrap grid system?

Bootstrap Version 3.x As always, read Bootstrap’s great documentation: 3.x Docs: https://getbootstrap.com/docs/3.3/css/#grid-nesting Make sure the parent level row is inside of a .container element. Whenever you’d like to nest rows, just open up a new .row inside of your column. Here’s a simple layout to work from: <div class=”container”> <div class=”row”> <div class=”col-xs-6″> <div class=”big-box”>image</div> … Read more

XAML Grid Visibility Transition?

So as a quick example, one way of doing this; <Grid Grid.RowSpan=”2″ x:Name=”TheGrid” Margin=”30,30,0,30″ Visibility=”{Binding IsSearchEnabled, Converter={StaticResource visibilityConverter}}”> <Grid.RowDefinitions> <RowDefinition Height=”60″/> <RowDefinition Height=”*”/> </Grid.RowDefinitions> <!– Start the magic –> <Grid.RenderTransform> <TranslateTransform x:Name=”SlideIn” X=”750″ /> </Grid.RenderTransform> <Grid.Triggers> <EventTrigger RoutedEvent=”Grid.Loaded”> <BeginStoryboard> <Storyboard> <DoubleAnimationUsingKeyFrames Storyboard.TargetName=”SlideIn” Storyboard.TargetProperty=”X”> <SplineDoubleKeyFrame KeyTime=”0:0:1.25″ Value=”0″ /> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames Storyboard.TargetName=”TheGrid” Storyboard.TargetProperty=”Opacity”> <SplineDoubleKeyFrame KeyTime=”0:0:1.55″ Value=”1″ /> … Read more