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
76
votes
2 answers

How do I Add a Tooltip To a DataGridTextColumn

I'm using WPFtoolkit DataGrid ,I have to wrap text in a DataGridTextColumn or I have to add a ToolTip to the text column. I have searched the net but i couldn't get a proper solution. Expecting your valuable suggestions...
sreeejith unnikrishnan
21
votes
4 answers

WPF C# Data-binding to DataGridTextColumn

I'm having a difficult time getting any data in this datagrid view to appear. I've followed some suggestions in a few other StackOverflow forum posts but am not having any luck getting the content to appear.
DisplayName13579
  • 229
  • 1
  • 2
  • 6
14
votes
3 answers

Create style for TextBlock in DataGridTextColumn

I want to create a global style that sets the VerticalAlignment to Center for all TextBlock controls inside a DataGrid or inside a DataGridTextColumn. I don't want to copy the following into every DataGridTextColumn because it feels…
timmkrause
  • 3,367
  • 4
  • 32
  • 59
14
votes
3 answers

How to set DataGridTextColumn text color?

I'm trying to change the color of a DataGridTextColumn. Here's what I'm doing:
Arsen Zahray
  • 24,367
  • 48
  • 131
  • 224
9
votes
1 answer

WPF DataGrid cell string format as a style or template

I tried several ways to factor out the format of a cell in a WPF DataGrid (the one provided with .NET 4): a data converter, the "StringFormat" binding property within a style, the "StringFormat" binding property within a data template. I will…
9
votes
1 answer

WPF DataGridTextColumn binding doesn't accept decimals

I don't understand what the problem could be. The binding is on a Decimal property. Here is the XAML: I literally cannot type…
Price Jones
  • 1,948
  • 1
  • 24
  • 40
9
votes
3 answers

DataGridTextColumn.MaxLength?

How do I set the MaxLength property of the DataGridTextColumn?
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
6
votes
1 answer

How to make WPF Datagrid Column non-focusable?

I have a WPF DataGrid being used for data entry but some DataGridTextColumn are information only and I have set their IsReadOnly="True" so their cells do not go into edit mode. However, they can still receive focus which I want to avoid. Is there a…
Gary Barrett
  • 1,764
  • 5
  • 21
  • 33
5
votes
2 answers

Find root element of DataGridColumn

I am using the LogicalTreeHelper.GetParent() method recursively to find the root elements of various other WPF elements. This works fine with almost everything, but it fails for the DataGridColumn such as DataGridTextColumn. I found out that…
mbuchetics
  • 1,370
  • 1
  • 17
  • 34
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
4
votes
2 answers

how to set binding stringformat to all DataGridTextColumn controls?

This is one of my DataGridTextColumn controls looks like : Then how can I set…
JatSing
  • 4,857
  • 16
  • 55
  • 65
4
votes
2 answers

Add padding to DataGridTextColumn in WPF

I have the following DataGrid:
Harry Boy
  • 4,159
  • 17
  • 71
  • 122
4
votes
2 answers

Masking password column in datagridview

I'm having problem with masking the password column. The code below works, but it doesnt work the way I want. While editing it do mask the password but when I am done and continue to the next datagridviewcell password becomes visible. private void…
BarisY
  • 171
  • 2
  • 4
  • 14
4
votes
1 answer

C# creating 2 rows, the first one is a text view list and the second is a comb box list

My project is a C# application to import data from an excel sheet to the database and prompt the user to map them manually. I need to create two rows: The first row is a DataGridTextColumn where the excel's headers fit to. The second row is a…
4
votes
4 answers

WPF DataGridTextColumn Can't type point for float data

I had a WPF DataGrid and use DataGridTextColumn Binding to a Collection. The items in Collection had some float property. When my program launched, I modify the value of float property in DataGrid, if I type a integer value, it works well. But if I…
Alvin
  • 83
  • 1
  • 5
1
2 3 4 5 6 7 8