All Questions

Tagged with
Filter by
Sorted by
Tagged with
9 votes
1 answer
4k views

Why is my Grid Tapped event not being called?

It's true that I'm not actually tapping in the simulator - as my dev machine is not touch-enabled - but I don't think that's the problem, as my clicking within the grid should fire the event. Here's ...
B. Clay Shannon-B. Crow Raven's user avatar
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) ...
Ignacio Soler Garcia's user avatar
3 votes
3 answers
10k views

Winform custom GridLayout? [closed]

I am trying to make a GridLayout for my form. Each cell needs to contain an image and label underneath describing the picture. I was wondering what was the best way to attack this issue?
Daerik Fisher's user avatar
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 ...
Micahstuh's user avatar
  • 495
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 ...
user316117's user avatar
  • 8,131
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 ...
JoeMjr2's user avatar
  • 3,884
3 votes
1 answer
2k views

Getting tile from coordinates on staggered isometric grid

I can't figure out the math. I have a staggered 2d isometric grid, got no problem into converting the grid cells into world coordinates, but now I can't figure out how to reverse the process. Here is ...
reonZ's user avatar
  • 145
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 ...
Onur's user avatar
  • 5,115
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 ...
Jamie Keeling's user avatar
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 ...
digz6666's user avatar
  • 1,818
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'...
djcouchycouch's user avatar
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 ...
user5890660's user avatar
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 ...
Joe's user avatar
  • 2,546
1 vote
1 answer
219 views

Enumerate neighboring cells in a 'rhombus'-shape on a grid

I'm currently working on a project which features a grid with cells. Every cell has the ability to query its neighboring cells with a function that accepts a relative 'x' and 'y'-coordinate. This ...
Rob Wijkstra's user avatar
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" ...
NeoRage's user avatar
  • 11
1 vote
1 answer
531 views

C# WinRT Make a Control size fill its parent

I'm an experienced developer, but new to C# and the Windows Runtime. I'm trying to create a custom UserControl (a specialized button) that can be dynamically sized. My button should have three rows of ...
Kenny Wyland's user avatar
  • 21.2k
1 vote
1 answer
68 views

Get 2D list value with Point for input (C#)

For uni I'm programming this game where there is a grid int[,] grid;. I also have this class: public class Point { public int x; public int y; public Point(int x, int y) ...
Jord van Eldik's user avatar
1 vote
2 answers
370 views

accessing y coordinates from a list of string arrays

So, I have a list which has an array of strings inside it, which (the arrays) are of different lengths. foodmenu.menumethod(); var menugrid = foodmenu.menumethod(); // method for category lists ...
xxish's user avatar
  • 49
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 <...
Carlos Heiras's user avatar
1 vote
0 answers
3k views

Unity3D (2D) Grid Based path following and line drawing system not working

I'm currently working on a set of scripts. The collective purpose of these scripts is to create a controller object that, upon the user clicking on an object, will check if the object is a GridCell ...
Ashley's user avatar
  • 121
0 votes
1 answer
585 views

Changing the span of CollectionView while rotating phone isn't working

I'm trying to change the span of CollectionView while rotating my iPhone. To make it easy, just show 2 columns in portrait, and 4 columns in landscape. It works when rotating from portrait to ...
Harrison's user avatar
  • 323
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="...
Nick's user avatar
  • 596
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 ...
j.i.h.'s user avatar
  • 825
0 votes
1 answer
36 views

Dynamically Setting ScrollViewer Height

I'm currently working on a WinUI 3 app, and I'm trying to have a StackPanel above and below a ScrollViewer which will always be visible (not depending on the size of the screen or the elements in the ...
Borisonekenobi's user avatar
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 ...
Lance's user avatar
  • 261
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 ...
Marcus Mondel's user avatar
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 ...
Sergey Alikin's user avatar
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 ...
Nii's user avatar
  • 488
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, ...
Ben Voigt's user avatar
  • 281k
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 ...
Yoda's user avatar
  • 17.8k
0 votes
1 answer
923 views

No Scrollbar appearing for WrapGrid in Windows 8 application

I currently have a WrapGrid bound to an ObservableCollection of BitmapImages. What I wish is for these to be displayed, 4 items per row, extending downwards - and when the WrapGrid extends past the ...
Simon Kiely's user avatar
  • 5,950
0 votes
1 answer
43 views

How to Count The Number Of Columns Of An AdaptativeGridView

I need to apply a horizontal separator line bwteen items, when columns number change. So, it's necessary to get the number of columns of this UWP AdaptativeGridView, inside a SizeChanged event. ...
MervelMath's user avatar
0 votes
1 answer
1k views

Unity How to get position of child in Grid Layout Group

I have a gameObject(GameGrid) with a Grid Layout Group component, its parent is a gameObject(GameBox) with a Vertical Layout Group and his parent is (MainCanvas) is a Canvas. GameGrid = Grid Layout ...
Oliver's user avatar
  • 65
0 votes
2 answers
2k views

Unity Grid Layout Group Reverse Arrangement

How can I reverse the arrangement of a grid layout group? It is really easy to do it with vertical&horizontal layout groups cuz they literally have a toggle.
Kadir Özyıldırım's user avatar
0 votes
0 answers
198 views

grid column issue on Xamarin forms

I have this content page in xaml <ContentPage.Content> <StackLayout x:Name="stackMadre" VerticalOptions="FillAndExpand" HorizontalOptions="...
Salvatore Lorello's user avatar
0 votes
1 answer
788 views

Grid Layout group - Child's positions and sorting

Hey fellow programmers, Firstly, i want to explain the purpose of my task, which is to create an interactable UI grid where the user can select whatever grid element he is interested in. (This is ...
J_Gandrup's user avatar
0 votes
1 answer
346 views

Xamarin.Android - GridLayout: Columns not visible

I'm working on a Xamarin.Android app, and I wish to use a GridLayout to display a simple form. However, the GridLayout doesn't display all the entry boxes found in the second column. If I place the ...
emile keen's user avatar
0 votes
1 answer
787 views

set focus on grid control in uwp programmatically

I am having a Grid control with a KeyUp handler attached to it in an UWP application. On this grid I am having a button. When clicking the button, the button keeps the focus. As a result the keystroke ...
Diolk's user avatar
  • 21
0 votes
1 answer
107 views

How to change GridLayoutGroup 's item sprite at run time in Unity

I'm implementing Inventory System for a Unity Game.Players have to pick only 3 items to pick from 18 inventory items(GridLayoutGroup).If the player click item,I want to change GridLayoutGroup item's ...
Htoo Aung Hlaing's user avatar
0 votes
0 answers
186 views

Xamarin.Android can't get GridLayout items width to equally divide

Im trying to add buttons in a GridLayout with 3 columns but the dont divide equally. The GridLayout matches parent width correctly. I have tried setting gravity and layout_width but to no success. How ...
user avatar
0 votes
0 answers
51 views

Handling objects in a tile-based system that are bigger than 1 tile

I have a twodimensional int array which stores blocks of different colors, they're based on the int value so for example 1 = blue and 2 = green. I have no issues so far where everything is just ...
Quaz's user avatar
  • 89
0 votes
1 answer
876 views

Width of a grid column

I have a problem with setting a Column width in my grid. That grid is auto-generated inside a button and I don't know the actual width of it nor the width of a window. I have defined two columns in it,...
Grzegorz Zieliński's user avatar
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 ...
Savantasaurus's user avatar
0 votes
2 answers
569 views

c# algorithm to find nearest tile with specific type

Sorry for the title but i didn't know how to describe my problem in one sentence. So basicly i am trying to create something to make random dungeons. I make rooms at random positions on a 2d grid ...
Flapperkewiet's user avatar
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 ...
user1005448's user avatar
0 votes
2 answers
134 views

How to wrap more than one div around a div

I have a div (Slideshow) and I want to wrap around it small divs (Items). The Slideshow div will be static and the Items will be rendered automatically using a Repeater Control. I made this image to ...
Mazen Elkashef's user avatar
0 votes
2 answers
175 views

C# - I am trying to create a grid lock game and I need your assistance

Since I don't have 10 reputation to post an image, I am going to leave a link of the game picture. http://thinkfun.com/mathcounts/play-rush-hour This is what I want to create. A game where a ...
Valdas Vabolis's user avatar
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....
user1610362's user avatar
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: ...
Steve Py's user avatar
-1 votes
2 answers
1k views

Unity Check overlap of rect works except if in gridlayoutgroup

So for my scene I have an Item and a Slot script. If the Slot script is applied to UI in GridLayoutGroup it doesn't read, even if it is hovering or not. However if Slot UI object is not ...
Darkal's user avatar
  • 1