Questions tagged [datagridcell]

Represents a cell of a DataGrid control.

Learn more about DataGridCell on MSDN.

126 questions
22
votes
5 answers

WPF DataGrid: How to Determine the Current Row Index?

I am trying to implement a very simple spreadsheet functionality based on a DataGrid. The user clicks on a cell The user types a value and presses return The current row is scanned and any cell formula that depends on the clicked cell is…
Travis Banger
  • 697
  • 1
  • 7
  • 19
21
votes
11 answers

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…
newman
  • 6,841
  • 21
  • 79
  • 126
14
votes
2 answers

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…
maayaa
  • 171
  • 1
  • 1
  • 6
13
votes
3 answers

Select DataGridCell from DataGrid

I have a DataGrid WPF control and I want to get a specific DataGridCell. I know the row and column indices. How can I do this? I need the DataGridCell because I have to have access to its Content. So if I have (for example) a column of…
gliderkite
  • 8,828
  • 6
  • 44
  • 80
11
votes
2 answers

Binding DataGridCell ToolTip property to value of DataGridCell

I have DataGrid and one of the DataGrid columns looks like this
monstr
  • 1,680
  • 1
  • 25
  • 44
7
votes
1 answer

DataGrid tab navigation skip column

I have a datagrid with template columns in WPF. Couple of columns in the grid are readonly, others on focus become editable (instead of labels, textboxes, checkboxes and such appear). What I would like to achieve is that the readonly columns are…
Vladan Strigo
  • 551
  • 1
  • 7
  • 19
5
votes
1 answer

WPF DataGrid Binding DataGridCell Content

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…
GreatSeaSpider
  • 262
  • 6
  • 14
5
votes
1 answer

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... How to get Binding value of current cell in a WPFToolkit DataGrid I…
PhilBrown
  • 2,949
  • 7
  • 34
  • 53
5
votes
3 answers

WPF Datagrid Cell with Validation Error Style

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.
joerage
  • 4,863
  • 4
  • 38
  • 48
4
votes
2 answers

WPF DataGridCell Template with TextBlock - Binding?

i replace the ContentPresenter in the DataGridCell's Template with a TextBlock an now i search for the correct Binding to the content. The normal way is Text="{TemplateBinding Content} for the TextBlock - it doesn't work. Also Text="{Binding…
frank_funk
  • 183
  • 2
  • 3
  • 11
3
votes
1 answer

DataGridCell content template selector Silverlight

I have a DataGrid with the dynamic data (collection of custom DataRows), which i get from the server. DataRow has an indexer and a property Data which returns whole data row for the binding (you'll see below) I create each column of a DataGrid in…
3
votes
1 answer

React BaseTable rowSpan "flickering"

Problem As seen in the interactive BaseTable API playground here, the spanning rows flicker on/off when I start scrolling. This is a known bug in the library, and there have been numerous issues posted regarding…
meerkat
  • 932
  • 2
  • 14
  • 38
3
votes
3 answers

WPF datagrid - enable selecting, disabling text input

I have a C# WPF Datagrid, with a checkbox column, hyperlink columns and text columns. My DataGrid is bound to a DataTable. The columns are not auto generated, but I do create them in code dynamically, since the number of columns is not known in…
Yoni
  • 275
  • 2
  • 4
  • 8
3
votes
2 answers

Select multiple cells in DataGrid and output to Excel sheet

I have a DataGrid with hundreds of rows and two columns of data. I will need to programmatically select a certain rows and some specific cell in a DataGrid and output them on an Excel worksheet. After doing some research, it seems the only way to…
KMC
  • 19,548
  • 58
  • 164
  • 253
3
votes
2 answers

WPF DataGrid disabled cell is receiving text input

Consider the following DataGrid having three columns: When ever the age is -1 the corresponding cell gets disabled. Ideally it shall not be possbile for the user to change the disabled cell value. However consider the user is in row 1 and the…
Abbas
  • 3,872
  • 6
  • 36
  • 63
1
2 3
8 9