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
0
votes
0 answers

Specific adaptive design of WPF Grid

I need to tune parameters of elements in the specific way but there's some cunning trick logic, which I can't implement yet. Let me please draw a picture. On this picture black border is the Window's border, blue lines mean Grid, and yellow ones…
0
votes
1 answer

Add scrolling to a StackPanel in a Grid Column

currently I try to add a vertical Scrollbar to my StackPanel by subordinate the StackPanel to my ScrollViewer. But with this "Solution" the content in my StackPanel dissapears and neither i have the Scrollbar. My XAML:
0
votes
1 answer

How to reuse slightly different DataTemplate elements?

In WPF, I have defined a grid of elements. They will be shown or collapsed depending on the properties of objects in an array in the ViewModel. In the XAML file, the DataTemplate looks like this:
Corbie
  • 819
  • 9
  • 31
0
votes
1 answer

WPF How to put button into row which is inside column

How can I put button into row which is inside column?
Kamsiinov
  • 1,315
  • 2
  • 20
  • 50
0
votes
0 answers

WPF Image fit to content inside a Canvas which is inside a Grid

I have an implementation in which I'm having a scrollviewer in a UserControl. Inside the scrollviewer I have a Grid which contains a canvas. Canvas in turn has an Image inside it. Something like this.
KaranKakwani
  • 160
  • 12
0
votes
2 answers

Dynamically adding grid rows filled with bound textboxes

I recently finished my first MVVM styled app which had a set number of columns/rows and controls in them. What I'm trying to do now is, based on the number of items in an observableCollection, add a row to the main grid filled with…
pfinferno
  • 1,779
  • 3
  • 34
  • 62
0
votes
2 answers

WPF Grid Mouse Events

I was wondering, what is the best way to capture a mouse Event inside of a wpf Grid? I wanted to Capture an event when the mouse wheel is either scrolled up or down in the Grid. I tried to create a custom grid, but that kind of didn't work. Any…
Joe Dough
  • 1
  • 1
-1
votes
2 answers

How can I set multiple backgrounds for a grid in WPF?

I have a grid, which has 2 rows and 3 columns. I need 2 background images for my grid - one will be on the top of the other. (ZIndex of one background should be bigger than other background has). How can I achieve this? I will need to swap these 2…
alEN
  • 77
  • 1
  • 6
-1
votes
1 answer

Is there a way to check if a grid cell, NOT datagrid cell, contains an object

I'm assigning textboxes to cells in a grid but will like to confirm if an object already exists in the cell before assigning. Is it possible to query a row at a specific column that returns null if empty? I could create a list of lists representing…
Jack
  • 25
  • 7
-2
votes
2 answers

change a button's coordinates in a grid with a button

game grid interface I am doing a 15 puzzle game on wpf and xaml where you need to move the empty tile in a grid to solve the puzzle. (see the linked image for context) I want to know how I can go about changing a button's coordinates when switching…
MGB
  • 1
  • 1
-2
votes
1 answer

How to Implement Attachable Properties for ItemTemplate and ItemsSource

I am trying to use the WPF Grid as an ItemsControl using attached properties for the purposes of creating a scalable Piano Keyboard. Each key in the keyboard may span 1 to three columns depending upon what precedes and succeeds it and will span 1…
Sphynx
  • 135
  • 2
  • 12
1 2 3
4