grid

Kendo MVC Grid: Creating a Custom command button and passing parameters

半城伤御伤魂 提交于 2019-11-30 19:07:27
I'm trying to create a custom command button to fire a custom delete function. I need to pass the ID of my model to my custom delete function. You'll notice that I'm trying to pass in a static '5' as a test but I would like to pass in the ID of the row. Any help would be greatly appreciated. @(Html.Kendo().Grid(Model) .Name("Grid") .Columns(columns => { columns.Bound(p => p.Name).Width(240); columns.Bound(p => p.City).Width(170); columns.Bound(p => p.State).Width(170); columns.Command(command => { command.Edit(); command.Custom("Delete").Click("PropertyPage.DeleteProperty").HtmlAttributes(new

Draw Diagonal Line in WPF Grid

断了今生、忘了曾经 提交于 2019-11-30 18:59:50
I think I am trying to do something relatively simple in WPF, but can't for the life of me figure out how; and think I am probably on the verge of overcomplicating it. If I had a grid which was 3 rows and 3 columns, and I wanted to join the corners of two cells to create a diagonal border, what would be the best way of doing so? The lines should ideally re-size if the control is resized (so bound to the corners of the cell?). Essentially I would like to create the red lines in the diagram hosted here: Example Pic http://imm.io/7A4L You could use a Path with Stretch=Fill. For the top right cell

Grid with background image and color

泪湿孤枕 提交于 2019-11-30 17:58:05
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> </Grid> The only way that I can think of is to use the Background Property to set the Color, then add an

how to style Grid ColumnDefinitions in WPF

倖福魔咒の 提交于 2019-11-30 17:20:37
I want to know how can I style a Grid so that I don't need to specify the <Grid.ColumnDefinitions> <ColumnDefinition Width="auto" SharedSizeGroup="SG1"/> <ColumnDefinition Width="auto" SharedSizeGroup="SG2"/> </Grid.ColumnDefinitions> every time? Thank you very much! ps: I did try to search on Google first. But I couldn't find any answer. Anyone who find the answer from google could you please tell me what keyword do you use to search? Sometimes I find it hard to determine what keyword use to search. ps2: I am too lazy, every I just open chrome and type something and search. If nothing found,

In WPF, how can I determine what column/row in a grid a control is in?

巧了我就是萌 提交于 2019-11-30 17:00:27
问题 I am building a grid dynamically and putting buttons in one of the columns. When I click a button, I want to know what row of my grid it's in. How can I find this? 回答1: In the Click event handler for the button you say: int row; Button btn = sender as Button; if (btn != null) { row = Grid.GetRow(btn); // And you have the row number... } else { // A nasty error occurred... } 来源: https://stackoverflow.com/questions/363100/in-wpf-how-can-i-determine-what-column-row-in-a-grid-a-control-is-in

jqGrid subgrid button / multiselect checkbox positioning?

人盡茶涼 提交于 2019-11-30 16:15:11
I'm looking for a way to move the expand/collapse button that appears when you enable a subGrid in a jqGrid from the left end of the rows to the right. Is there an easy way to accomplish this? Likewise, can you control the placement of the checkbox that appears on the left when you enable multiselect? It would be trivial if these were actually inside the colModel, but it seems to be done for you under the hood. Any way to override? jQuery("#test").remapColumns([0,2,3,4,5,1],true,false); seems to be close to what I need, but it doesn't play well with the "hidden" columns, like the two I'm

Magento Grid Container Block not loading grid

喜欢而已 提交于 2019-11-30 13:25:46
问题 I just set up an admin module with a grid view using the module creator, and it works great, but now I need to add another grid view within the same module. I copied and renamed all the files relevant to the grid view(controllers and block files, but not models, as they are not needed for what I'm doing) , and added the newly created block to the layout xml under the handle for it's new controller. Using Firephp, I've worked out that everything loads fine for my new view up until the Grid.php

How to change extjs grid single cell background color depending on value changes?

Deadly 提交于 2019-11-30 12:36:53
问题 To change whole row background color we can use getRowClass, but how to do the same logic only for one cell, and particular column....any ideas? //EXTJS viewConfig: { getRowClass: function(record, index) { var c = record.get('change'); if (c < 0) { return 'price-fall'; } else if (c > 0) { return 'price-rise'; } } } //CSS .price-fall { background-color: #FFB0C4; } .price-rise { background-color: #B0FFC5; } EDIT: There is a way of doing this with: function change(val){ if(val > 0){ return '<div

Hexagonal tiles and finding their adjacent neighbours

孤街浪徒 提交于 2019-11-30 12:25:24
问题 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)

Dynamically toggle visibility of WPF grid column from C# code

丶灬走出姿态 提交于 2019-11-30 11:33:16
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# code. I've tried achieving this by setting the the column's definition width to zero, e.g. Column1.Width =