datagrid

DataGrid.ColumnHeaderStyle and Command Binding

元气小坏坏 提交于 2019-12-24 12:29:49
问题 In the XAML below, the command property is correctly working only with Column B. Clicking on Column A's header is not invoking command's execute method. The difference is that in Column B, DataGridColumnHeader is instantiated explicitly. On other hand, the second part of style, the trigger that sets background base on Pressed state is working for both columns. Why does the Command property work with Column B & not with Column A ? <DataGrid x:Name="Test" ItemsSource="{Binding Items}"

WPF Binding in DataGridColumnHeader DataTemplate

邮差的信 提交于 2019-12-24 12:14:30
问题 So, this is an extension to the following question: Style DataGridColumnHeader with Styles in WPF In short, I'm trying to put filters in my DataGridColumnHeaders by templating the column headers with a combobox. So the difference with the other example is that I'm using ComboBoxes instead. <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="300" Width=

C# WPF DataGrid Change cells color by value

末鹿安然 提交于 2019-12-24 11:28:00
问题 I am new to WPF and trying to highlight Datagrid cells by their value. I have loaded a list of items to the DataGrid, and I want to mark all the wrong input values (represented as value "0"): 回答1: I have made a simple sample to just guide you how it can be done Xaml code <DataGrid x:Name="dataGrid" IsEnabled="True" CanUserAddRows="False" AutoGenerateColumns="False" Width="275" HorizontalAlignment="Left"> <DataGrid.Columns> <DataGridTextColumn Header="ID" Binding="{Binding ID}" Width="25"/>

WPF DataGrid bind data between columns

若如初见. 提交于 2019-12-24 11:17:40
问题 Lets say I have 2 columns in my data Grid: Column A: Selected, and Column B: Name. The Selected column is a checkbox. And Name column is text field. I want to set the color of the text in 'Name' column as Blue if Column A's check box is checked, and Red otherwise. Essentially I don't know how to bind data between columns of the datagrid. And sample code/link providing example would be useful. 回答1: I haven't used the WPF Toolkit's DataGrid much, but from what I can gather, one method is to use

Change datagrid selected row colour after paint

依然范特西╮ 提交于 2019-12-24 10:48:50
问题 Using this code paint datagrid cell for special records when load data. foreach (DataColumn item in dt.Columns) { FormattableTextBoxColumn tbcName = new FormattableTextBoxColumn(); if (item.ColumnName == "S") { tbcName.Width = 40; tbcName.MappingName = item.ColumnName; tbcName.HeaderText = item.ColumnName; tbcName.SetCellFormat += new FormatCellEventHandler(ColumnSetCellFormat); } tableStyle.GridColumnStyles.Add(tbcName); } datagrid.TableStyles.Add(tableStyle); Then highlight cell using below

How to unselect checkboxes after bulk action execution?

一个人想着一个人 提交于 2019-12-24 10:37:33
问题 On a List module, I created a bulk action button to generate PDF by calling a custom action. The problem is <Datagrid> checkboxes are not unselected once the action is executed. Here is my custom action: export const print = (resource, ids, data) => ({ type: DOWNLOAD, payload: { id: ids.length === 1 ? ids[0] : ids, data, }, meta: { resource: resource, fetch: PRINT, onFailure: { notification: { body: 'ra.notification.http_error', level: 'warning', }, }, }, }); And here is my button: class

WPF data grid for financial style reporting?

谁都会走 提交于 2019-12-24 10:31:58
问题 I'm looking for a decent WPF data grid or solution involving one to represent financial data. I've looked at many - the WPF one, XCeed, Ingragistics, DevExpress, etc.... but none of them seem to offer the simple requirement I have: I want to be able to display group subtotals in their columns in the group row, e.g. GROUP 1 xxxx.xx GROUP 2 xxxx.xx ROW 1 xx.xx ROW 2 xx.xx Does anyone know of a grid that does this, or a nice supporting collection that implements aggregate functions (group totals

JQuery math operations for my DataGrid

谁说胖子不能爱 提交于 2019-12-24 10:24:59
问题 I have the following data grid: $('.dateP').datetimepicker(); $('.dupli').on( 'click', function(e){ var dup = $('.cpy').first().clone(); $('.table').append( dup ); $('.dateP').datetimepicker(); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link href="https:/

From DataTable to BindingList

可紊 提交于 2019-12-24 10:22:47
问题 I am in the process of switching over from DataTable to BindingList. I bind the DataTable to the DataGrid object. Here my dilemma: while I certainly see the advantages of switching over, my circumstances will make it a bit complex and I am wondering whether it is worth it to switch over. My scenario: I have a DataGrid which displays chemical samples. There are 5 kinds of sample type, where the columns in the grid will differ for each type (and sometimes within the same type based on other

DataGridTextColumn event binding

余生长醉 提交于 2019-12-24 09:25:52
问题 What is the simplest way to bind an ICommand to a DataGridTextColumn that will handle a user double click on that column without code behind? Can I somehow expose an underlying FE and do it all in the XAML? This particular column is read only and here is the xaml for it: <dg:DataGridTextColumn Header="Number" Binding="{Binding BusinessId}" Width="75" IsReadOnly="True" CanUserReorder="False" /> Cheers, Berryl 回答1: the short answer is no. you cant create a new command property on a column in