datagrid

Visualizing 2D Data in a Table

妖精的绣舞 提交于 2019-12-23 21:16:58
问题 I need some help and need to be pointed in the right direction. I am creating a WPF application which should display 2-dimensional data. It should be shown like this: ------------------------- |y/x| 1 | 2 | 3 | 4 | 5 | | 1| 1 | 2 | 3 | 4 | 5 | | 2| 2 | 4 | 6 | 8 | 10| | 3| 3 | 6 | 9 | 12| 15| | 4| 4 | 8 | 12| 16| 20| | 5| 5 | 10| 15| 20| 25| ------------------------- Some sample code: XAML: <Window x:Class="WpfApplication6.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml

How to show Persian date in WPF DataGrid?

这一生的挚爱 提交于 2019-12-23 19:48:46
问题 How can I change this code (or somewhere else): <DataGridTemplateColumn x:Name="timeColumn" Header="time" IsReadOnly="True"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <DatePicker SelectedDate="{Binding time, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> To show date in Persian format? time in database is in Timestamp format. I want just "show it" in Persian format, and have

Accessing the WPF DataGrid “empty” or “rowcolumn” header

房东的猫 提交于 2019-12-23 18:15:01
问题 I am trying to get access to the header that is at the intersection of the rows and columns headers in a Net3.5 WPF DataGrid. Josh Smith calls this the "Empty Header" in an article on a different grid control and I would call it the "RowColumn" header since it in the first position for both the column and row headers and is the only header that is part of both. It defaults to a button with a lower right hand arrow that when you press selects all the items in the DataGrid. I can see this

智能商贸系统09-采购订单

南楼画角 提交于 2019-12-23 17:58:30
1、准备数据 完成下面几个类的基本CRUD,具体的页面后面完成 systemdictionarytype:数据字典类型 systemdictionarydetail:数据字典明细 Supplier:供应商 Product:产品 2、采购订单分析 拿到数据库中的表,主要从下面3点进行分析 每个字段的含义 这个字段是否可以为null 这个字段从哪里来? 2.1、采购订单Purchasebill 订单与订单详细为组合关系,组合关系为强聚合 聚合关系为多对一和一对多的关系,强聚合为不可分割的聚合关系 组合关系,一般一方放弃维护关系,交给多方(mappedBy) CascadeType级联,使用all。并且使用orphanRemoval 级联保存,确保一方找到多方,多方找到一方 级联删除,比较危险,删除自己并且删除关系的,所以使用orphanRemoval,先解除关系,再删除 /* * 采购订单 * */ @Entity @Table ( name = "purchasebill" ) public class Purchasebill extends BaseDomain { //交易时间,前台传来 private Date vdate ; //总金额,计算 private BigDecimal totalAmount ; //总数量,计算出来 private BigDecimal

How to disable automatic sorting in Editable Datagrid in Flex 4

不打扰是莪最后的温柔 提交于 2019-12-23 17:29:46
问题 I have an editable datagrid. If sorting is applied by clicking any header of datagrid, it works fine. But after that, if data values are changed in any row of datagrid, sorting is applied automatically. How to prevent from this behaviour? i.e. sorting should only be applied if user clicks on any header of datagrid and sorting should not be applied when user modifies data in grid. 回答1: You have to set sortableColumns to false and handle the headerRelease event, where you do the sorting

Disabled row on Datagrid WPF getting selected when clicked with the Right Mouse Button

旧城冷巷雨未停 提交于 2019-12-23 17:04:25
问题 I got some problems in Datagrid WPF I have a datagrid, and I want to set the IsEnabled property of a single row to false whenever the user assign a value to the binding item of the datagrid itemSource So I made it by datagrid Style triggers: <DataGrid AutoGenerateColumns="False" Margin="9,35,0,6" Name="dataGrid2" ItemsSource="{Binding}" SelectionChanged="dataGrid2_SelectionChanged" IsReadOnly="True" SelectionMode="Single"> <DataGrid.RowStyle> <Style TargetType="{x:Type DataGridRow}"> <Style

WPF DataGrid lost focus after row delete

感情迁移 提交于 2019-12-23 12:36:52
问题 I am using WPF DataGrid row deletion by keyboard "Delete" key press. However, after the row is deleted, DataGrid lost its focus, and DataGrid.SelectedIndex = -1. Compared to WinForm datagrid, after a row is deleted, the focus automatically shift to the next focusable row, which is much more reasonable. By " next focusable ", I mean, e.g.: Row A Row B Row C If we delete Row A, the next focusable will be Row B. If we delete Row B, the next focusable will be Row C. If we delete Row C, the next

WPF SelectedItem property in nested DataGrid in UserControl

拥有回忆 提交于 2019-12-23 12:29:51
问题 I have UserControl , lets call it as CustomDataGrid , that contains DataGrid . Remained content doesn't matter. SelectedItem property of DataGrid must be SelectedItem property of CustomDataGrid . And I wanna be able to use Binding with this property, cause I use MVVM pattern. So I have to declare SelectedItem as DependencyProperty in CustomDataGrid . But I have no ideas haw can I make it properly... This is how DepedencyProperty -s is declared usually: public static readonly

WPF DataGridTextColumn Can't type point for float data

大憨熊 提交于 2019-12-23 12:28:36
问题 I had a WPF DataGrid and use DataGridTextColumn Binding to a Collection. The items in Collection had some float property. When my program launched, I modify the value of float property in DataGrid, if I type a integer value, it works well. But if I type char . for a float value, char . can't be typed. I had to type all the numbers first, and then jump to the . position to type char . to finish my input. So how can I type . in my situation? Thanks. 回答1: Also met the same problem. For my case,

How to print flex spark datagrid by using the mx PrintDataGrid? Or is there other way to achieve this without using the mx PrintDataGrid?

ⅰ亾dé卋堺 提交于 2019-12-23 12:15:40
问题 this is my first time to ask here since my question is not answerable in the adobe flex forum. So at least finally, I've come to manage it here. Well, Flex 4.5+ is I guess everyone is working on nowadays so I asked this question since I haven't yet find working both spark datagrid and the mx printdatagrid components together . What I'm trying to achieve is to print all the data inside my spark datagrid. So when I do my research, we use the PrintJob or the FlexPrintJob classes. It works fine