grid

WPF Grid and DataGrid sizing

对着背影说爱祢 提交于 2019-12-08 06:01:58
问题 The UserControl I'm trying to work with is essentially laid out like so: <Grid> <Grid.RowDefinitions> <Row Height="*"/> <Row Height="*"/> </Grid.RowDefinitions> <wpftoolkit:DataGrid x:Name="PrimaryGrid"/> <!-- ~10 rows --> <Border> <Grid> <Grid.RowDefinitions> <Row Height="*"/> <Row Height="*"/> </Grid.RowDefinitions> <wpftoolkit:DataGrid x:Name="SecondaryGrid"/> <!-- ~2 rows --> <wpftoolkit:DataGrid x:Name="OtherGrid"/> <!-- ~50 rows --> </Grid> </Border> </Grid> This UserControl is then

Changing color of grid in C# (Windows Phone 8)

被刻印的时光 ゝ 提交于 2019-12-08 04:46:50
问题 I am trying to change background color of grid (with name "colorPlace") in my simple app (when I click on button). I tried (where red, green and blue are bytes): colorPlace.Background = new SolidColorBrush(Color.FromArgb(255, red, green, blue)); and: colorPlace.SetValue(BackgroundProperty, "#FFFFFFFF"); And all I just get is: An exception of type 'System.NullReferenceException' occurred in Project.DLL but was not handled in user code Any ideas how to do it? EDIT: Oh, I just find an solution -

Viewport 3D WPF C#

馋奶兔 提交于 2019-12-08 04:32:31
问题 Can you please show how to set and save the background color of the viewport3D. Whenever I save no background is visible only model, I tried the grid but that gets everything in the grid? Any help will do? 回答1: Viewport3D doesn't have a Background property so you need something behind it. your approach using a Grid is right, you might want to use a Border to enforce the use of a single child. <Border Background="Green"> <Viewport3D Width="640.0" Height="480.0" > <ModelVisual3D/> </Viewport3D>

Drawing lines between JLabel in 2d array grid

ぃ、小莉子 提交于 2019-12-08 04:05:11
问题 I'm trying to draw lines between cells which are JLabel but fail to get their coordinates. The lines must follow a path from a startPoint to an endPoint. In my View class, the below code creates the grid: void createGrid(int rows, int cols) { MyMouseListener listener = new MyMouseListener(); setRows(rows); mainPanel.setLayout(new GridLayout(rows, cols, 1, 1)); mainPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK)); mainPanel.setBackground(Color.DARK_GRAY); grid = new JLabel[rows]

GridSplitter to Resize from Right - Odd Behaviour

血红的双手。 提交于 2019-12-08 02:23:32
问题 Using Kaxaml, resizing from the left works as expected. <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid> <Grid HorizontalAlignment="Left"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto"></ColumnDefinition> <ColumnDefinition Width="Auto"></ColumnDefinition> <ColumnDefinition Width="Auto"></ColumnDefinition> </Grid.ColumnDefinitions> <GridSplitter Grid.Column="1" Width="5" Background="DarkGray"

Make grid align properly

梦想的初衷 提交于 2019-12-08 02:04:26
问题 In my app I'm displaying some info about users in a listbox. I've got most of the stuff as I want, but the layout is bugging me a bit. It's made with grids, so that it'll re-size and fit portrait/landscape modes. However, I cannot get the layout to "fix itself"... let me try and explain with pictures: As you can see the numbers at the right side isn't aligned to the right edge of the screen. How do I achieve this? Landscape mode looks almost okay: Below is some of the XAML: <ListBox

How to change the background of a grid to an image in WP7 silverlight?

狂风中的少年 提交于 2019-12-08 01:48:50
问题 I'm trying to set a background for a grid control in WP7 silverlight, I need to do that programatically, not in the desighn. I tried something like: ContentPanel.Background = new BitmapImage(new Uri("Images\Backgrounds\with box\13.jpg", UriKind.Relative)); But of course, I got an error, because on the right hand we should have the type SolidColorBrush . is there a way to do that? Thanks.. 回答1: I would firstly recommend that you use a Canvas instead of a Grid. You can do this by deleting the

How do I draw a multi-column UITableView?

霸气de小男生 提交于 2019-12-07 23:58:37
问题 I want to draw a multi-column UITableView like the picture below, which is different than a common Custom Cell. How do I do this? 回答1: Is it horizontally scrollable? It doesn't look so. If it's only vertically scrollable, use a regular UITableView. For each row, you use a UITableViewCell as usual. For each column, just use a UIButton or any widget that you like. In your screenshot, it looks like columns but there is no underlying concept of columns. You can easily create custom UITableView

Create a custom Grid Item in Xamarin

我的梦境 提交于 2019-12-07 17:20:13
问题 I have a GridLayout in my Xamarin.Forms App and I would like each element in the grid shown here: to be an instance of something like this: Where each element (brand, picture, price, seller etc.) is set by getting a value from an array and placing that value into the cell. For example, if I am only using the brand and the picture (in the form of strings) for now, and I have just retrieved data from my SQL database in the form of two lists: (pseudocode) brand = ["supreme","louisvuitton",

Change the layout or cols value of md-grid-list based on screen size

▼魔方 西西 提交于 2019-12-07 16:14:13
问题 I am using Grid List of angular material 2. Here is the plunker https://plnkr.co/edit/0v9R3e4x3tThh85147x7?p=preview Here I have defined a grid list of three columns and there are three tiles (showing in a row as defined as three columns). I want to change the layout direction of tiles like if the screen size gets shrunk at a certain point then all the tiles should be in column one below the other that is somehow value of cols parameter changed to 1. How is it possible? Is it possible with