grid

How do I make a StringGrid's columns fit the grid's width?

孤街浪徒 提交于 2019-12-05 09:04:05
I've been looking for a long time for a solution without any luck. Does anyone know a simple way to do that? I would like to stretch for example the second colum of my grid to fit the grid's width! Use the ColWidths property, like so: with StringGrid1 do ColWidths[1] := ClientWidth - ColWidths[0] - 2 * GridLineWidth; And for a more robust and flexible solution, take all fixed columns into account and parameterize the column index: procedure SetColumnFullWidth(Grid: TStringGrid; ACol: Integer); var I: Integer; FixedWidth: Integer; begin with Grid do if ACol >= FixedCols then begin FixedWidth :=

Firemonkey Grid Control - Aligning a column to the right

主宰稳场 提交于 2019-12-05 08:20:13
I am using the FireMonkey Grid control but have an on-going issue in trying to right align a column. From other users postings, I have managed to create a new TColumn type, apply a style to this (text as HorzAlign=taTrailing) and in theory - thought that this would be solution. The values are provided by the OnGetValue function to the Grid control. The problem is however that although at first it looks OK, if you scroll the bar/mouse wheel etc. the new TColumn type column does not appear to refresh correctly using the method/code below. It could be a bug/feature of the Grid (or the way I am

Grid generation & division with css/js/php

ぐ巨炮叔叔 提交于 2019-12-05 07:56:30
问题 I am working on a web project, and I am thinking on how to best approach the following scenario: I have a bunch of images in a database and I want to load this in a grid. High ranked images need to have a bigger canvas, while lower/not ranked ones don't. The size of the images are not standard so it could be either a portrait or a landscape picture with each different sizes. The aspect ratio needs to remain intact, and the window needs to be totally filled horizontally (with a width of 100%).

Post Kendo Grid data to Controller in MVC

痞子三分冷 提交于 2019-12-05 07:47:06
I have two classes. One that contains a list of the other class: public string Name { get; set; } public string Surname { get; set; } public int Age { get; set; } public List<Models.Occupation> Occupations { get; set; } The second class is as follows public string Name { get; set; } public string Industry { get; set; } My controller rendering the view Person p = new Person() { Name = "megan", Surname = "du Preez", Id = 0, Age = 22 }; return View(p); In the view @model Models.Person <form id="person"> <div> @Html.TextBoxFor(mp => mp.Name) @Html.TextBoxFor(mp => mp.Surname) @(Html.Kendo().Grid

How Can I Nest Custom XAML Elements?

删除回忆录丶 提交于 2019-12-05 07:10:53
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplication1" Title="Window1"> <Grid> <local:ElementType x:Name="FirstElementName"> <local:ElementType x:Name="SecondElementName" Grid.Column="1" Grid.Row="1" /> </local:ElementType> </Grid> </Window> And this is in other files ... <Grid x:Name="InternalElementName" x:Class="WpfApplication1.ElementType" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft

Algorithm to find all points on a 2D grid some distance away from another point

最后都变了- 提交于 2019-12-05 06:14:13
I have some point on a 2D grid (x, y) and I need to find all points that are n distance away from that point. The way I'm measuring distance is by using the distance formula between the two points. Anyone know how to do this? Edit: Just for reference, what I'm trying to do is to write some AI path finding that will maintain some distance away from a target in a system that uses grid based locations. Currently I'm using A* path finding, but I'm not sure if that matters or makes a difference since I'm kind of new to this stuff. Here's what I would do: First filter out all points that are further

Kendo grid: How to check all checkboxes of selected rows?

北战南征 提交于 2019-12-05 05:54:19
问题 I am using the Telerik Kendo grid with MVC and C#. I have a grid, populated with some data and have added a checkbox column - used so that the user can select all. Now, when I check the "selectAll" checkbox, all checkboxes are checked (one for each row), as they should be. What I want to do: I want to be able to double-click on a row and have the chechbox check change - if it is unchecked, a dbl-click will check it and visa versa. Also, as the Kendo grid allows the user to select many

wpf listbox and datatemplate with grid inside

◇◆丶佛笑我妖孽 提交于 2019-12-05 05:21:17
问题 I have a following question. I want to have ListBox with DataTemplate as Grid . This grid has 2 two columns. I want to set first column width to 3* and another to * . How to do this? I will copy my code. <ListBox x:Name="commandListbox" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" HorizontalAlignment="Stretch"> <ListBox.ItemTemplate> <DataTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="3*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <TextBlock Grid

MouseDown doesnt work in Grid (only on buttons which in grids)

。_饼干妹妹 提交于 2019-12-05 05:14:26
I have problem with MouseDown event. My app looks like that, I have grid in which im adding buttons in code behind <Grid Grid.Column="1" Name="gridWithButtons" MouseDown="normalModeButtonsWP_MouseDown" > <WrapPanel Name="normalModeButtonsWP" MouseDown="normalModeButtonsWP_MouseDown" ></WrapPanel> </Grid> But when im pressing mouse button in grid/wrappanel ( i mean in empty space between buttons for example) it doesnt work. Works only when im pressing button which is in wrap/grid. Anyone know how to handle it? Setting IsHitTestVisible alone will not make it work. Elements are not clickable if

Change the MenuItem icon in angular ui.gird

纵然是瞬间 提交于 2019-12-05 04:11:27
问题 How to toggle the customizing_column_menu icons in angular ui.grid like shown below 回答1: I didn't found any best solution to change menuItems dynamically, Here is what I did for workaround Code $scope.gridOptions = { rowHeight: 75, columnDefs: [{ field: 'name', enableColumnMenu: false }, { field: 'gender', enableHiding: false, suppressRemoveSort: true, sort: { direction: uiGridConstants.ASC } }, { field: 'All Details', cellTemplate: '<p ng-show="grid.appScope.company"><label><b>Company:</b><