grid

Programmatically setting the width of a grid column with * in WPF

偶尔善良 提交于 2019-11-30 03:10:28
I want to programmatically configure a wpf grid. I want to be able to set a grid with 2 columns, the first taking up 20% of available space, the second taking up 80%. In xaml I would use the * operator but I cant work out how to do this programmatically. In Xaml I would do: <Grid> <Grid.ColumnDefinitions> <ColumnDefinition width="20*" /> <ColumnDefinition width="80*" /> </Grid> In code I want to do: Grid grid = new Grid(); grid.ColumnDefinitions.Add( new ColumnDefinition(20*) ); grid.ColumnDefinitions.Add( new ColumnDefinition(80*) ); Please could someone advise. Grid grid = new Grid();

Algorithms question: flipping columns

☆樱花仙子☆ 提交于 2019-11-30 02:26:53
Suppose that we are given an m x n grid of zeros and ones and want to transform the grid so that the maximum number of rows are composed solely of ones. The only operation we are allowed to perform on the grid is picking some column and flipping all of the zeros and ones in that column. We are also given some integer k and must perform exactly k columns flips. Given the grid and the value of k, how do we determine which columns to flip to maximize the number of rows that are all ones? I'm thinking something dynamic would need to be done, but I'm not able to arrive at a good answer. Can someone

Hexagonal tiles and finding their adjacent neighbours

左心房为你撑大大i 提交于 2019-11-30 02:04:48
I'm developing a simple 2D board game using hexagonal tile maps, I've read several articles (including the gamedev one's, which are linked every time there's a question on hexagonal tiles) on how to draw hexes on the screen and how to manage the movement (though much of it I had already done before). My main problem is finding the adjacent tiles based on a given radius. This is how my map system works: (0,0) (0,1) (0,2) (0,3) (0,4) (1,0) (1,1) (1,2) (1,3) (1,4) (2,0) (2,1) (2,2) (2,3) (2,4) (3,0) (3,1) (3,2) (3,3) (3,4) etc... What I'm struggling with is the fact that I cant just 'select' the

Grid with background image and color

假装没事ソ 提交于 2019-11-30 01:41:57
问题 Is it possible to give an entire grid in xaml both a background image and a color? I am not scaling the image so there are regions that do not have a color. Is it possible to color the rest of the grid in a color? This is my current code: <Grid> <Grid.Background> <ImageBrush Stretch="None" ImageSource="Images/background_top.png" AlignmentY="Top" AlignmentX="Center"/> </Grid.Background> <Grid.RowDefinitions> <RowDefinition Height="50*" /> <RowDefinition Height="50*" /> </Grid.RowDefinitions> <

wpf gridlines - changing style

谁说胖子不能爱 提交于 2019-11-30 01:27:42
Is there any way to change the style of gridlines in wpf grid? I need to divide grid into 4 cells. To do it I used RowDefinitions and ColumnDefinitions. However I need user to distinguish which cell is which, that's why I need to change the color of the gridlines. It depends on the look you are going for. In WPF, there are different ways to do almost anything. Here are a couple of the easier ones. The easiest way is to set ShowGridlines="True": <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5" ShowGridLines="True"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /

How can I add a line between two columns using Twitter Bootstraps grid system

对着背影说爱祢 提交于 2019-11-29 21:15:08
Two column layout with a line in the middle. [ ] | [ ] [ ] | [ ] [ ] | [ ] [ Left Column ] | [ Right Column ] [ ] | [ ] [ ] | [ ] [ ] | [ ] [ ] | [ ] GaryP I think I got your question right... this the below codes. The inline style below is just for illustration. You apply your styling in the css file. <div class="container"> <div class="row-fluid"> <div class="span6" style="padding-right:20px; border-right: 1px solid #ccc;"> <p>Some Contents Here...</p> </div> <div class="span6"> <p>Some Contents Here...</p> </div> </div> </div> The above code shall output this image . Ross Angus My solution

how to get selected row value in the KendoUI

安稳与你 提交于 2019-11-29 19:32:13
I have a kendoUI grid. @(Html.Kendo().Grid<EntityVM>() .Name("EntitesGrid") .HtmlAttributes(new { style = "height:750px;width:100%;scrollbar-face-color: #eff7fc;" }) .Columns(columns => { columns.Bound(e => e.Id).Hidden().IncludeInMenu(false); columns.Bound(e => e.EntityVersionId).Hidden().IncludeInMenu(false); columns.Bound(e => e.Name).Width("70%").Title("Entity Name"); columns.Bound(e => e.EIN).Width("30%"); }) .ToolBar(toolBar => toolBar.Template("<a class='k-button k-button-icontext k-grid-add' id='addEntity'><span class='k-icon k-add'></span>Entity</a>" + "<a class='k-button k-button

Mosaic Grid gallery with dynamic sized images [closed]

只愿长相守 提交于 2019-11-29 18:35:32
I have just received the following design for a project, for an image grid gallery, with dynamic width & height images (user submitted images). (Screenshot at the end of post) I have tried jQuery Masonry , Tympanus Automatic Image Montage and CSS-Tricks Seemless Responsive Photo Grid , but each has their limitation. Jquery Masonry allows for both width and height to be dynamic, however there are gaps generated The latter 2 scripts, generate very nice grids, but with the problem that either width or height must be static EDIT: i came across, Isotope , which is almost perfect and i will probably

how data in grouping grid will be shown

我与影子孤独终老i 提交于 2019-11-29 18:01:36
I am using this article of architecture http://blog.extjs.eu/know-how/writing-a-big-application-in-ext/ Here is my Application.ResellerGrid.js Application.ResellerGrid = Ext.extend(Ext.grid.GridPanel, { border:false ,cityname : '' ,columndataindex : '' ,fromdate:'' ,todate : '' ,initComponent:function() { var config = { store:new Ext.data.GroupingStore({ // store configs autoDestroy: true, autoLoad :false, url: 'api/index.php?_command=getresellers&city='+this.cityname+'&columndataindex='+this.columndataindex +'&fromdate='+this.fromdate+'&todate='+this.todate , storeId: 'getresellerscount', //

Dynamically toggle visibility of WPF grid column from C# code

荒凉一梦 提交于 2019-11-29 17:37:27
问题 My problem is: I can't find out how to toggle the visibility of my WPF grid column. Assume following XAML markup: <Grid x:Name="myGrid"> <Grid.RowDefinitions> <RowDefinition x:Name="Row1" /> <RowDefinition x:Name="Row2" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition x:Name="Column1" /> <ColumnDefinition x:Name="Column2" /> </Grid.ColumnDefinitions> </Grid> Aferwards the grid is filled with some controls etc. Now I want to hide a single column dynamically out of my C#