datagridcell

WPF Datagrid Cell with Validation Error Style

Hi, I am trying to change the default style of a DataGridCell (within a WPF Toolkit DataGrid) when there is a validation error. The default is a red border. How can I put my own template? Thanks. ...

Inheriting from DataGridTextColumn and overriding GenerateElement

I'm attempting to create a custom DataGrid where I can format individual cells based on the cell value (ie; red text for negative values, green for postitive) ala this approach... http://stackoverflow.com/questions/686165/how-to-get-binding-value-of-current-cell-in-a-wpftoolkit-datagrid I also need to convert the values from negative t...

Accessing control between DataGridCells, dynamic cascading ComboBoxes

Hello. I have a DataGrid that two of its columns are ComboBoxes (one contains few but not this is the problem). I want, that when the user changes the first Combo's value, the ComboBox in the other column should bind to a property of its (this property is a collection). Say the First ComboBox is Category, I want that when the user chan...

Access DataGridCell's children from another DataGridCell?

Hello! I have a DataGridCell that contains a ComboBox. I want, that when I fire 'SelectionChanged' event of it, a CollectionViewSource of a different column (eventually - at runtime, cell) CellEditingTemplate's Resources should be populated with data according to the selected value for this row. Maybe DataTrigger, ActionTrigger, Event...

WPF DataGrid Binding DataGridCell Content

Hi there, This is hopefully going to be a really simple answer, I'm just not seeing the proverbial wood for the trees I think. I've got a DataGridCell style in which I want to bind the content of the cell to the source property of an image, here's the XAML I'm using at the moment: <Style x:Key="DataGridImageCellStyle" TargetType="{x:T...

Binding a cell object's property to a DataGridCell in WPF DataGrid

Using the WPF DataGrid I have the need to change various display and related properties of a DataGridCell - such as Foreground, FontStyle, IsEnabled and so on - based on the relevant value of the cell object property. Now this is easy to do in code, for example (using an Observable Collection of ObservableDictionaries): var b = new...

WPF - How to get a cell from a DataGridRow?

I have a data-bound DataGrid with alternating row background colors. I would like to color a cell differently based on the data it contains. I have tried the solution suggested by this thread http://wpf.codeplex.com/Thread/View.aspx?ThreadId=51143 But, DataGridCellsPresenter presenter = GetVisualChild(row) always returns null. I am...

How to make WPF DataGridCell ReadOnly?

I understand you can make the whole DataGrid or a whole column readyonly (IsReadOnly = true). However, at cell level this property is ready only. But I do need this level of granularity. There is blog about adding IsReadOnly to a row by changing the source code in old days when DataGrid was public domain, but now I don't have source code...

Disable context menu on some DatGrid cells WPF

I have defined a datagrid like this :: <cc:PEDataGrid AutoGenerateColumns="False" ItemsSource="{Binding Rows}" Width="Auto" PreviewMouseRightButtonDown="PEGrid_PreviewMouseRightButtonDown" Loaded="CommonPEGrid_Loaded"> <wpfkit:DataGrid.Contex...