Questions tagged [datagridtextcolumn]

Represents a DataGrid column that hosts textual content in its cells.

Represents a DataGrid column that hosts textual content in its cells. This column hosts TextBlock elements for cells that are not in editing mode and a TextBox control for a cell that is in editing mode.

By default, the DataGrid control generates columns automatically when you set the ItemsSource property. The generated columns are of type DataGridCheckBoxColumn for bound Boolean (and nullable Boolean) properties, and of type DataGridTextColumn for all other properties. If a property does not have a String or numeric value type, the generated text box columns are read-only and display the data object's ToString value.

112 questions
0
votes
0 answers

WPF DataGridTextColumn can't be changed by user when the grid has many columns

My problem sounds simple, but unfortunately it's not. I have a DataGrid with 23 columns, each of them has MinWidth set to some value, Width = "Auto" . One of the columns has Width = "*", because it's the name of the object and has to fit the…
Redzix
  • 170
  • 3
  • 15
0
votes
0 answers

WPF Datagrid not taking up all available remaining space

I have a WPF DataGrid and no matter what I try it won't resize to fit the available space. In my Window there is a lot of empty space to the right and I want the columns to change their width according to the space available. The code I have for…
Kafka
  • 21
  • 2
0
votes
0 answers

DataGridTextColumn foreground [Theme Resoruce] does not change in dark mode

Using "ThemeResource" I want to change the foreground depending on whether it is in light mode or dark mode But it only works in Light mode, in dark mode use the default color DataGridTextColumn
Rickxp
  • 13
  • 4
0
votes
1 answer

WPF DataGridTextColumn binding relation table data (WPF / EF / PRISM)

I have a code, but binding association table data doesn't work. There are two tables, one Products table and one supplier table. Products XAML
yang
  • 31
  • 1
  • 3
0
votes
0 answers

How to get the `DataGridTextColumn` name and header of a `datagrid `through `code-behind`?

I am working with datagrid and I want to get the name and header of the datagridtextcolumn in code behind. I have tried getting header value as `Datagrid.Columns[0].HeaderText` . But HeaderText is not working in my code. Another way I tried…
Fahad
  • 55
  • 1
  • 8
0
votes
0 answers

How do you set the ValidationRules of a DataGridTextColumn via attribute and not nested tags?

I've been trying to perform some simple validation logic on a column, and so far I have it working with nested tags:
SCORP.io
  • 140
  • 1
  • 9
0
votes
1 answer

How to display ellipse and/or scroll bar in DataGridTextColumn Header when column shrinks?

I am trying to figure out how to force my column header to display an ellipse and/or scroll bar when the column shrinks. I know that the data inside of the textblock (column) can shrink to an ellipse but I can't figure out how to make the header do…
J Bradley
  • 1
  • 1
0
votes
1 answer

Why is DataGridTextColumn's bound ObservableCollection is not updated?

In my XAML I have definde a DataGrid containing DataGridTextXolumns. All of the simple columns updates the source (ObservableCollection) well, but not the source field which is a List field. What am I missing to define in the…
du-it
  • 2,561
  • 8
  • 42
  • 80
0
votes
1 answer

DataGridTemplateColumn with custom control

I've created custom control (Add/Subtract column on picture) and put it to DataGridTemplateColumn of DataGrid control:
wsc
  • 50
  • 1
  • 8
0
votes
2 answers

SL4 - Binding DataGridTextColumn to a property

I have a DataGrid. In the DataGrid's AutoGeneratingColumn event I have some code that looks like this: if (e.Property.Name.Contains("MetaData")) { var descCol = new DataGridTextColumn(e.Property); var bnd = new…
Brent Lamborn
  • 1,370
  • 3
  • 17
  • 37
0
votes
0 answers

How to bind a Dep property within DataGridTextColumn

How can I bind a List Property inside DataGridTextColumn to bind a list from main window. For this I use public class DataGridListBoxColumn : DataGridTextColumn { TextBlock tx = new TextBlock(); public DataGridListBoxColumn() …
babucr
  • 11
  • 5
0
votes
1 answer

Get a control from DataGridTextColumn without searching through the whole DataGrid children

I have a textbox inside a datagrid header. I am trying to get its content when clicking on a totally unrelated button elsewhere in the page (cannot use selectedItem). Was able to implement it using the below code. XAML :
Sajith Sageer
  • 163
  • 3
  • 16
0
votes
1 answer

WPF: Binding to the Binding mode

In WPF I try to use databinding to define the BindingMode.
Coden
  • 2,579
  • 1
  • 18
  • 25
0
votes
1 answer

Typing Text into DataGridTextColumn doesn´t work

.. but pasting text does. What could be the reason?
Woife M.
  • 3
  • 1