All Questions
Tagged with grid-layout wpf
50
questions
36
votes
3
answers
23k
views
Is there a RowSpan="All" in WPF?
I create a GridSplitter across the 3 rows that I have in my grid like this:
<GridSplitter Grid.Row="0" Grid.Column="1" Background="Yellow"
HorizontalAlignment="Stretch" ...
19
votes
2
answers
43k
views
How to split a Grid row into two columns?
I have the Grid layout with 3 rows.How do i split the 3rd row into 2 columns.
<Grid.RowDefinitions>
<RowDefinition Height="0.75*"/>
<RowDefinition Height="0.25*"/>
<...
10
votes
2
answers
3k
views
How to align separate Grids created via templates along their columns / rows?
I thinks that in this case A picture is worth a thousand words:
XAML:
<Grid>
<ItemsControl ItemsSource="{Binding Persons}">
<ItemsControl.ItemTemplate>
<...
5
votes
3
answers
4k
views
How can I fill all the space in a datagrid text column header with a grid?
I'm incredibly new to wpf, and I'm having trouble with some formatting in my column headers. I want to have a Textblock with my title, and a button in my header that will eventually be a filter ...
4
votes
1
answer
3k
views
Drag and Drop Reorder controls within Grid panel WPF
I am almost new to WPF.
I have a Grid panel shown in the picture. I want to add the drag & drop functionality so that a user can reorder the buttons within the cells of the grid (The user should ...
4
votes
0
answers
425
views
How to freeze the first row and first column on a WPF grid
Is there a way to freeze the first row and first column of a grid (not data grid) in WPF? My application has a grid that contain line chart controls and I would like to have the first row to hold ...
3
votes
3
answers
8k
views
Wpf - Grid using row and column definition - How to ignore columns for some rows
I'm trying to use the grid row / column definitions in my wpf application. At the moment, I need to implement a list view inside a GroupBox. Here I need to ignore the column definitions i set in the ...
3
votes
4
answers
6k
views
How to size the WPF Grid panel this way?
I have this pretty simple window with a Grid containing two columns, a TextBlock and a TextBox.
What I need it to set the column 0 to automatically size to its content and to have column 1 (content) ...
3
votes
1
answer
73
views
How to prohibit certain cells from resizing row or column
I am creating a 2x2 grid layout in XAML. The top left is a groupbox. The top right is a listbox, with a visible scrollbar. The bottom is a double-width groupbox. As items are added to the top right ...
3
votes
2
answers
3k
views
How to add textBox programmatically into Grid?
I have a WPF Grid I want to insert some images into at runtime. The MSDN at
http://msdn.microsoft.com/en-us/library/system.windows.controls.grid%28v=vs.110%29.aspx
gives this example, using text ...
3
votes
1
answer
1k
views
WPF how to reset grid row and column sizes to "*" in code
I have a grid that contains several controls in rows of a grid. I have the RowDefinitions set so that each row in the grid has a height of "*" in the XAML, so that all the controls have the same ...
2
votes
3
answers
9k
views
Limit row's height on both "Auto" and "1*" in WPF
I have a WPF application which layout consists of 3 rows in a top level Grid.
I want the middle row to use up the space it needs (the maximum space it needs is limited but depends on the width of the ...
2
votes
1
answer
904
views
ListBox does not use all available space within Grid.Column - WPF
I have a ListBox control that has been assigned to Grid.Column 0 which has a value of '*' defined for it's width, however when rendered there is a sizeable amount of space that is not being used.
I ...
2
votes
1
answer
2k
views
How to make cell to take full width when aligned to right or left in WPF grid
I'm designing some grid in WPF and want to display numbers aligned to right, but when I set HorizontalAlignment=Right the cell itself don't use all available width, so the border is painted half based ...
2
votes
1
answer
54
views
Grid that reorganizes its cells depending on window size?
My application loads a series of 64x64 pixel images and displays them on a 4x4 grid. If I change the application window's size, I'd like the grid to reconfigure itself. Say if I resize the application'...
2
votes
4
answers
1k
views
Grid RowDefinintion fixed Height ignored
I have a simple Grid with two rows, the first having a fixed height. Inside, I have an element with RowSpan="2", and on top another element which should reside only in the first row:
<Grid ...
2
votes
3
answers
1k
views
WPF: DockPanel Last Visible Child Fill?
The behavior I'm looking for is basically that of a DockPanel, I would like the last child to fill the available space. The catch is that I would like it to be the last visible child. In my case I ...
1
vote
2
answers
1k
views
Link Expander action to RowDefinition height
I have the following grid:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
...
1
vote
1
answer
3k
views
XAML C# Hide Grid Row
I have a grid where I am trying to hide a row which contains a text box using c# as my code behind. My end goal is to find a way to set text in the text box while the row is hidden hidden. I may run ...
1
vote
1
answer
1k
views
WPF creates undesired margin when ColumnDefinitions' widths are dynamic?
Here's a WPF Window that contains a UserControl. The UserControl is a simple Grid with 2 columns without definite Widths. In the first column, I added a simple TextBox set to stretch horizontally. The ...
1
vote
1
answer
3k
views
How do I drag and move an image around inside a Grid in WPF?
How do I drag and move an image around inside a Grid?
Have been trying to solve my problem for days, to no outcome.. here is my code for the xaml.
<Canvas>
<Grid Canvas.Left="134" ...
1
vote
1
answer
81
views
Button doesn't show inside grid row
My user control seems fine with 0 errors and 0 warnings
But when I add my user control to the grid row it doesn't show all the buttons from my user control. There isn't errors or even warnings
<...
1
vote
1
answer
1k
views
WPF Grid: Use auto height but prevent scrolling
How can I use automatic row height in a WPF Grid control but limit it to the extent that the Grid doesn't scroll altogether?
Here's my UI:
1st row: Auto height, contains a label and text input (in ...
0
votes
1
answer
1k
views
WPF grid column 50% width
I need 3 columns in my Grid Layout, while looking like this:
50% of the window
rest of the place
30px wide
But I am unable to set this up, do any of you have idea ho to achieve this?
I tryed to toy ...
0
votes
3
answers
2k
views
Updating the Grid.ColumnSpan doesnt change the column span of the rectangle
<Window x:Class="ColumnSpan_Check.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="...
0
votes
2
answers
136
views
Unexplained grid layout width behavior
A novice at WPF / XAML, I've been wrestling with layout and trying to get it uniform. I'm using a listbox of grids, with different data in different columns. I'll start by saying the desired ...
0
votes
1
answer
771
views
Wpf Grid Layout
is WPF grid layout with * width or column, heavy for UIs?
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="334" />
<ColumnDefinition Width="Auto" /...
0
votes
2
answers
582
views
Getting keyboard input to a control based on a WPF Grid (System.Windows.Controls.Grid)
I have created a control that inherits from the WPF System.Windows.Controls.Grid.
I would like it to respond to key presses, but it doesn't.
It responds to Mouse input fine.
This is my constructor in ...
0
votes
1
answer
38
views
How to make changing number of columns fill entire width and center horizontally in WPF?
I have a Grid with 3 Columns in WPF. Each column is filled with a Vertical Stackpanel. The first column (and its content) is always visible. the 2. and 3. column are linked to checkboxes.
And i ...
0
votes
1
answer
59
views
Is there a way to produce a scrollable gridlayout with dynamic content?
Ì want to write a software where there is a grid layout inside a scrollview.
I already hardcoded it, but I think I need to find a solution to make this dynamic! How can I manage to do this! I am ...
0
votes
1
answer
750
views
Binding viewmodel property to view property in code behind using Prism
I use C# 7, Prims 6.3 and SyncFusion Grid Control for developing my application (https://help.syncfusion.com/wpf/grid/getting-started).
My problem is next: Grid Control is just "emulate" WPF-style, so ...
0
votes
1
answer
380
views
WPF - Lock Grid (Container) Star Size
Is there anyway a Star Sized Grid.Row or Grid.Height specified value can be locked?
take my current wip for example:
How or What do i do to keep the equivalent value of 1* that is allocated for Row ...
0
votes
1
answer
588
views
WPF Column set MIN height by dynamic margins?
Is it possible to set the minimum height of a row to be dynamic based on the content? A brief explanation:
I have this piece of UI:
The whole thing is divided into a grid with two rows, one * ...
0
votes
1
answer
416
views
WPF layout suitable for display of binary data
I have a WinForms display of some captured network data (binary). I'm trying to move to WPF as a learning exercise, and because it should be more maintainable going forward.
As you may have seen, ...
0
votes
1
answer
684
views
Java's JPanel with GridLayout equivalent in WPF's XAML
I would like declare in the XAML file a container that when I add any component to i it will behave like JPanel with GridLayout in Java. That means every component in that container will be the same ...
0
votes
1
answer
2k
views
WPF Grid Column auto with some room to grow
I have a Grid in WPF where the last column's size is Auto. However, in that column is text that, when I mouse over it, turns from normal to Bold, making the text a little bit bigger (as bold text ...
0
votes
0
answers
31
views
WPF Grid, remove highlight of cell click
I have a window like this
<Window x:Class="Värvivärten_Sendscreen.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://...
0
votes
0
answers
249
views
WPF collapsible tree with aligned columns
I'm trying to improve the real-time log display of a rather complicated system. Currently there is a significant tradeoff between situational awareness (improved by displaying only high-level events) ...
0
votes
2
answers
128
views
How can I render a WPF Grid that has 14 equal sized columns and 1 column 30% the size of the previous equal columns
I have a grid that is being overlayed an image. A user will input the total image length and width in meters. They will also input the size of the columns and rows they want.
For example the image is ...
0
votes
2
answers
830
views
Wpf listbox resize issue
I got a user-control containing a grid with two rows. In each row there will be a listbox. The problem is that when items are getting added to the listbox then the control just keep expanding so the ...
0
votes
0
answers
21
views
Excess border selection in WPF's Lisbox [duplicate]
My program is a sort of image picker, much like File Explorer's large image view.
I am using a ListBox with a Grid as Panel.
Problem is, the standard selection for ListBox items encompasses the ...
0
votes
1
answer
255
views
Two components in the same .xaml Grid.Row. When I scroll down, one of them floats, the other scrolls. I need both of them to scroll
I've come accross some .xaml code I need to fix. Currently, it's made of 2 grid components with this layout:
<Grid d:SomeDataContext>
<Grid.RowDefinitions>
<RowDefinition ...
0
votes
0
answers
163
views
MinHeight property makes datagrid and listview of different sizes
<Grid x:Name="LstGrid" Margin="5">
<ListView
x:Name="dataGroupList"
Width="{Binding ActualWidth, ElementName=LstGrid}"
Height="{Binding ActualHeight, ElementName=...
0
votes
1
answer
281
views
Stretching Grid inside another Grid
How can i stretch horizontally "SecondGrid"?
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas....
0
votes
1
answer
90
views
WPF layout problems using Grid and ListBox
I'm (sort of) a newbie in WPF. And I'm stuck with this layout. The Viewbox is displayed fine and so is the space (30%) for ListBox but I can't see ListBox in that space. Following is my XAML, just ...
0
votes
2
answers
543
views
Issue with WPF Grid proportional layout and unused area
I have a grid layout that splits a view into two parts, effectively for two sets of headings and list. I want each list to share the height of the active view evenly so I've used proportional sizing:
...
-1
votes
1
answer
91
views
(WPF/XAML) How can I create a responsive toolbar similar to the one from Window's Snipping Tool?
I'm trying to create a responsive toolbar in WPF that works like the one in the in Windows Snipping Tool (the one that opens if you press Win+Shift+S).
The Snipping Tool's toolbar has 3 groups of ...
-1
votes
1
answer
296
views
Can you make grid column/rows change dynamically with window size?
I'm supposed to make an app to design a restaurant, so like dragging and dropping tables from a toolbox and whatnot. I was thinking of dragging them onto a grid, but I need the rows and columns to ...
-1
votes
1
answer
148
views
Closest path between points on grid
I have grid dimension 2000x2000. I have some points stored on grid and I want to connect some of them, but connection need to be closest path from one to another.
I have :
private static readonly ...
-1
votes
1
answer
68
views
Adjust Grid Size according to the content
How can i define Grid size so that it can increase and decrease according to the TextBlock Content in wpf?