Questions tagged [wpf-grid]

A wpfgrid is a WPF Panel which arranges child elements in predefined columns and rows.

Full class name: System.Windows.Controls.Grid. Grid defines a flexible grid area that consists of columns (ColumnDefinitions) and rows (RowDefinitions). Child elements are positioned using attached properties Grid.Column and Grid.Row and can take more than one column/row if attached dependency properties Grid.ColumnSpan/Grid.RowSpan are set.

56 questions
47
votes
2 answers

Bottom borders on WPF Grid

I'd like to set a bottom border on each row in the grid, but can only find how to put all 4 borders around each cell..
Marko
  • 71,361
  • 28
  • 124
  • 158
11
votes
2 answers

Collapse Grid Row in WPF

I have created a custom WPF element extended from RowDefinition that should collapse rows in a grid when the Collapsed property of the element is set to True. It does it by using a converter and a datatrigger in a style to set the height of the row…
Dan
  • 7,286
  • 6
  • 49
  • 114
8
votes
3 answers

Multiple Auto column definitions causing weird GridSplitter behavior

I have the following XAML:
Zev Spitz
  • 13,950
  • 6
  • 64
  • 136
8
votes
1 answer

How to stretch button all over the grid, xaml

I have a problem with stretching the button all over the grid. My code look like this:
MNie
  • 1,347
  • 1
  • 15
  • 35
7
votes
3 answers

How to collapse a star sized grid column in WPF?

Getting three columns have the same width is done by setting Width to Auto.
broadband
  • 3,266
  • 6
  • 43
  • 73
4
votes
2 answers

WPF ScrollViewer pushing control out of window

I have a DockPanel, which contains some controls including a ScrollViewer. What I WANT to happen, is for the ScrollViewer to allow the grid to be scrolled, without pushing other controls off the bottom of the form. Instead, the ScrollViewer expands…
Interminable
  • 1,338
  • 3
  • 21
  • 52
3
votes
1 answer

How to fix Grid Row and Columns not uptading in wpf?

I'm trying to make a snake game in WPF and I decided to use a grid to display the board. The snake is supposed to move its x and y position changing the grid column and grid row property. To achieve this I made a SnakePlayer class, a Food class. In…
RANDOM NAME
  • 41
  • 1
  • 6
3
votes
1 answer

WPF Grid white stripes

I have a Grid with a lot of buttons inside. These buttons are supposed to be seamlessly connecting. In most of the cases, this is actually working, but sometimes there's a white stripe between the columns / rows of the grid: I'm adding the buttons…
MetaColon
  • 2,895
  • 3
  • 16
  • 38
2
votes
1 answer

Grid style in app.xaml makes content invisible

I want to define a grid style in the app.xaml, including the background color. However, setting the color there, makes the whole content instantly invisible. When application is executed, the following appears: For a short moment, the button is…
Malior
  • 1,221
  • 8
  • 16
2
votes
2 answers

WPF Using GridSplitter for individual Row Column in Grid

I want to have GridSplitter that resizes only one cell (actually not correct term per se for WPF Grid, let's call it individual Grid[r][c]) and cell adjacent to it to be resized. Here what I tried:
Bhanu Chhabra
  • 474
  • 1
  • 6
  • 22
2
votes
1 answer

Oscilloscope Display

I am trying to design a GUI for an oscilloscope as a part of my MTech project. While I have no problem setting the scale after taking the input from the user for the X and Y axes, I am facing trouble displaying the waveform. Right now, I am using a…
ScottSummers
  • 310
  • 1
  • 13
2
votes
2 answers

WPF prevent dynamic grid contents from stretching beyond parent size

Have a UserControl that must never exceed 700px in width. Have set it's MaxWidths to 700px. Inside is a grid - 3 columns. First and second column will have labels, third column will input fields. Label contents will be dynamic based on language.…
user1250290
  • 123
  • 3
  • 12
1
vote
1 answer

Grid column with width="*" does not use all available space as expected

I have a problem with my first ListView usage. My custom item should have (currently) 2 rows with 3 columns each containing a label (1st column width="Auto"), a textbox (fill-up 2nd column (tested with="" or width="100") and a button in the 3rd…
Gaston
  • 115
  • 1
  • 7
1
vote
1 answer

How can I tell a grid which column to shrink when needed

I'm wanting to limit a Grid.ColumnDefinition to a maximum width but I do not know the width to do this programatically. Consider the following XAML:
Paul
  • 5,700
  • 5
  • 43
  • 67
1
vote
1 answer

How to remove a parent from UIElement? WPF

I have some grid with border (grid name is "maingrid") Border brd1 = new Border(); this.maingrid.Children.Add(brd1); SomeClass = new SomeClass(brd1); Then I have another window with a constructor and with grid too (grid name is "somegrid") public…
bone_appettit
  • 105
  • 1
  • 6
1
2 3 4