datagrid

WPF Change datagrid cell background color using a converter

北慕城南 提交于 2020-01-30 03:47:13
问题 I have an WPF datagrid. There are two columns of type datetime which I need to compare and according to the compare result, I set a cell background color for the two cells in the current column and row. I do this for each datagrid row. In order to do this I use a converter. <my:DataGridTextColumn Binding="{Binding Path=Date1, StringFormat=\{0:dd/MM/yyyy\}}" Header="Date"> <my:DataGridTextColumn.ElementStyle> <Style TargetType="TextBlock"> <Setter Property="Background"> <Setter.Value>

Why is my ExtJS datagrid populating as empty?

ぐ巨炮叔叔 提交于 2020-01-25 22:36:17
问题 I am trying to make a proof of concept ExtJS datagrid en route to moving to a server-based store. At present my code is as follows: var arrayData = [ ['', 'Held', '', '', 'abc', '', '100.00', '0.00', 'Internal Approval'], /* 11 similar rows deleted for sanitization's sake */ /* I've tried with and without quotes around the monetary amounts. */ ]; var nameRecord = Ext.data.Record.create([ {name: 'approved_date', mapping: 1}, {name: 'approval_status', mapping: 2}, {name: 'approval_id', mapping:

Why is my ExtJS datagrid populating as empty?

自作多情 提交于 2020-01-25 22:34:11
问题 I am trying to make a proof of concept ExtJS datagrid en route to moving to a server-based store. At present my code is as follows: var arrayData = [ ['', 'Held', '', '', 'abc', '', '100.00', '0.00', 'Internal Approval'], /* 11 similar rows deleted for sanitization's sake */ /* I've tried with and without quotes around the monetary amounts. */ ]; var nameRecord = Ext.data.Record.create([ {name: 'approved_date', mapping: 1}, {name: 'approval_status', mapping: 2}, {name: 'approval_id', mapping:

How to query 2 collections into 2 datagrids with mongodb driver and binding

痞子三分冷 提交于 2020-01-25 09:34:08
问题 I have created a reorder application. As storage I am using a MongoDB server. I want to carry out CRUD operations by clicking buttons in my main view. The create operation is already running smoothly. Now I am trying to get the READ (QUERY) operation done. My MongoDB collection reorders has the following structure: The most important part here is the "artikelliste" -key because it inherits all the key value pairs of my 2nd collection articles as you can see in the next structure(NOTE THAT THE

WPF add image to cell in column

戏子无情 提交于 2020-01-25 07:36:13
问题 Using C#.NET4.5, Visual Studio 2012, WPF. Well here's how far I got with a lot of help from great people and advice! Set up a new column for images: DataGridTemplateColumn p1 = new DataGridTemplateColumn(); p1.Header = "p1"; FrameworkElementFactory factory1 = new FrameworkElementFactory(typeof(System.Windows.Controls.Image)); Binding b1 = new Binding("picture"); b1.Mode = BindingMode.TwoWay; factory1.SetValue(System.Windows.Controls.Image.SourceProperty, b1); DataTemplate cellTemplate1 = new

DataGrid inside Datagrid virtualization

穿精又带淫゛_ 提交于 2020-01-25 04:21:05
问题 I need to create a DataGrid inside a DataGrid. It works but I have a problem with the virtualization. With one DataGrid, the RowVirtualization works fine. Now, when I create a DataGrid inside a DataGrid, the virtualization from the inner datagrid doesn't work and it takes very long to load an item with many rows. I think the problem is the outer datagrid which loads one row completely and inside this row there is the datagrid with a lot of rows and the RowVirtualization doesn't work. Does

Silverlight实例教程 – Datagrid,Dataform数据验证和ValidationSummary

百般思念 提交于 2020-01-24 23:54:24
上一篇,我们讨论了,捕获用户提交数据验证。本篇将集中讨论Datagrid和Dataform两个数据控件的数据验证方法,其中,我们会附加介绍一个新的验证控件ValidationSummary。 概述 Datagrid和Dataform是Silverlight中最常用的两个数据控件,其主要目的是作为数据集合的载体控件。这两个控件不仅支持自动数据绑定,而且允许用户添加许多自定义行为操作,例如编辑,排序,删除,添加等。而在日常项目开发中,经常会碰到用户在编辑,或者添加时对数据的验证判断,在数据commit前,即捕获数据异常并返回提示信息到客户端。 ValidationSummary控件 在Datagrid和Dataform数据验证中,最为常用的是 ValidationSummary控件 ,该控件和WebForm中的ValidationSummary控件类似,其功能都是将错误信息集合显示在一个ListBox控件中。简单的说,ValidationSummary控件是一个能够容纳验证错误集合的容器,能够检测和显示当前页面所有验证结果到客户端。 命名控件 :System.Windows.Controls 装配 :System.Windows.Controls.Data.Input (位于 System.Windows.Controls,Data.Input.dll) 我们仍旧使用上一篇的源代码项目

WPF - Need a combination of Tree+Grid, with Context Menu

独自空忆成欢 提交于 2020-01-24 22:44:05
问题 My application is implemented by a GridView inside a TreeList . Much to my despair, I discovered that the GridView is very primitive, compared to the widely used DataGrid . I am considering these two options: (1) Somehow, I replace the GridView with a DataGrid (which supports Context Menu). (2) Somehow, I add the Context Menu capability to the existent GridView. Which of the 2 approaches (or another?) would you recommend? Source code is much appreciated. TIA. 回答1: Based on the linked code,

DragAndDrop selectedItems of one silverlight Datagrid into another

情到浓时终转凉″ 提交于 2020-01-24 19:30:08
问题 Currently I am using "DataGridDragDropTarget" to Drag a row from one datagrid to another, but a client want to be able to select multiple rows from one datagrid and drop them into another. I played around a bit but realized "DataGridDragDropTarget" seems to be able to drag and drop single row at a time only. Is there any alternative way to DragDrop multiple selected rows? 回答1: Pressing Shift key while dragging multiple rows to another datagrid really works for this. But can anyone suggest how

How to retrieve a changed value of databound textbox within datagrid

非 Y 不嫁゛ 提交于 2020-01-24 15:12:12
问题 ASP.NET 1.1 - I have a DataGrid on an ASPX page that is databound and displays a value within a textbox. The user is able to change this value, then click on a button where the code behind basically iterates through each DataGridItem in the grid, does a FindControl for the ID of the textbox then assigns the .Text value to a variable which is then used to update the database. The DataGrid is rebound with the new values. The issue I'm having is that when assigning the .Text value to the