Questions tagged [datagridtextcolumn]
Represents a DataGrid column that hosts textual content in its cells.
102
questions
0
votes
0answers
7 views
I need DataGridTemplateColumn with the same behavior as DataGridTextColumn
This two column behaves not the same way
<DataGridTextColumn
Width="50"
Binding="{Binding Path=Id, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
...
0
votes
0answers
24 views
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 ...
0
votes
0answers
22 views
How do you set the ValidationRules of a DataGridTextColumn via attribute and not nested tags? [duplicate]
I've been trying to perform some simple validation logic on a column, and so far I have it working with nested tags:
<DataGridTextColumn Header="Property">
<DataGridTextColumn.Binding>...
2
votes
1answer
61 views
WPF/DataGrid: Binding to different properties for displaying and editing
I have an object that contains eg a string property like "10; 20; 30". I have also a get property that splits the string, converts each part to a double and sums them up. Thus I have "10; 20; 30" and ...
0
votes
1answer
54 views
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 ...
0
votes
1answer
31 views
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<string> ...
0
votes
1answer
35 views
DataGridTemplateColumn with custom control
I've created custom control (Add/Subtract column on picture) and put it to DataGridTemplateColumn of DataGrid control:
<DataGridTextColumn Binding="{Binding Count}" Header="Count" Width="60"/>
...
0
votes
0answers
42 views
WPF Datagridtextcolumn sorting not working on first click after setting sortmember path
<DataGridTextColumn x:Name="HiddenColumn" Visibility="Hidden" Header="Make" CanUserResize="True" Binding="{Binding Make}" />
<DataGridTextColumn Header="Car" MinWidth="50" Width="150" ...
1
vote
1answer
373 views
DataGridTextColumn ValidationRule with parameter hibernateConnector not working
I try to implement a ValidationRule for a DataGridTextColumn that should test the nullability against a NHibernate property.
The check is actually done within my HibernateConnector.isNullable(String ...
0
votes
0answers
25 views
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 ...
0
votes
1answer
63 views
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 ...
0
votes
1answer
149 views
WPF: Binding to the Binding mode
In WPF I try to use databinding to define the BindingMode.
<controls:BoolToStringConverter x:Key="BoolToStringConverter" FalseValue="OneWay" TrueValue="TwoWay" />
<TextBox Text="{Binding ...
0
votes
2answers
637 views
Setting DataGridTextColumn Width
I have a MVVM WPF application.
I have a DataGridTextColumn in a WPF datagrid. I want to bind its width property to a converter and pass to it its cell value. For this column, there are cases where ...
0
votes
1answer
32 views
Typing Text into DataGridTextColumn doesn´t work
.. but pasting text does.
What could be the reason?
<DataGrid AutoGenerateColumns="false" Name="dataGrid" InitializingNewItem="dataGrid_InitializingNewItem" ItemsSource="{Binding ...
0
votes
1answer
181 views
WPF DataGridTextColumn MaxLength
I have a DataGrid with a DataGridTextColumn, I've set TextBlock.TextWrapping to NoWrap.
If I try to display a really really long line, over 10000 characters long the display just cuts of like it's ...
0
votes
1answer
18 views
IErrorDataInfo apply tooltip style to all DataGridTextColumns
I'm working in a WPF C# project, I had a lot of problems showing tooltips for validation purposes and I came across this solution in another post here on StackOverflow.
<DataGridTextColumn ...
0
votes
1answer
90 views
Converter not firing [duplicate]
I have below DataGridTextColumn in my datagrid:
<my:DataGridTextColumn Visibility="{Binding Path=DataContext.Filter, Converter={StaticResource ColumnVisibilityConverter}">
Filter is a ...
0
votes
1answer
176 views
WPF binding selected item in datagrid to a second datagrid and show value depending of it
I have two WPF datagrids. When a row is selected from first datagrid, dg1, a column called 'Notes' in second datagrid, dg2, should be shown as empty strings only and only if the content of the column '...
0
votes
1answer
2k views
WinForms: DataGridView - Show Combobox when cell being Edit
In a C# app, I have a DatagridView with all cells as DataGridTextBoxCol. Grid is populated dynamically with unbound values. Grid has different type of food items.
My need is, when user clicks/wants ...
0
votes
1answer
1k views
WPF Change datagrid cell background color using a converter
I have an WPF datagrid. There are two columns of type datetime which I need to compare and according to the compare result, I set a cell background color for the two cells in the current column and ...
0
votes
2answers
815 views
Set textbox text to 'Yes' or 'No' based on boolean property within a DataGridTextColumn
I have a datagrid and one of my column is like below:
<DataGridTextColumn Binding="{Binding Path=BoolPropertyValue}" Header="YesOrNo" HeaderStyle="{DynamicResource MyHeaderStyle}" Width="auto">
...
0
votes
1answer
69 views
WPF DataGridTextColumn contains backspace char
How can "BS" (alias Backspace, alias \b) be a value in a string property that is databound to a DataGridTextColumn:
XAML
<toolkit:DataGridTextColumn Header="K"
Width="...
1
vote
1answer
412 views
Edit behaviour of DataGridTemplateColumn
my DataGrid has a few DataGridTemplateColumn's like this:
<local:DataGridSyntaxColumn MinWidth="100" x:Name="cVariantNew1" Width="250">
<DataGridTemplateColumn....
0
votes
1answer
366 views
How to get the WPF column binding field from DataGridColumnHeader style
I am doing custom sorting for WPF datagrid (as I use pagination so I can not use default sorting), how can I get name of the field that column binding to? Below is my current code inside DataGrid....
1
vote
2answers
162 views
Executing a method on current row when editing a DataGridTextColumn
I currently have a DataGrid bound to a Person object:
<DataGrid ItemsSource="{Binding Person}" Width="1700" Height="840" AutoGenerateColumns="False" CanUserAddRows="true" ...>
<DataGrid....
0
votes
1answer
743 views
How to access DataGridTextColumn String format from code behind c#?
I'm using WPF to display Products on my DataGrid, for database I am using MySql database,
decimals in mysql are stored as 100.30, 100.10, 90.40, as you can see mysql is using dot(".") as separator ...
1
vote
1answer
152 views
Evaluate Datagrid row value with previous value
I need to create a new property for DataGrid in DataGridTemplateColumn, where this property will be boolean and will indicate whether the column will be evaluated or not by the following rule; When ...
0
votes
1answer
2k views
C# DataGridTextColumn line break
There must be a simple solution for this, but I just can't find it. I have a DataGrid with DataGridTextColumns which contain data. This is working fine. I just seem to not get the String inside the ...
3
votes
1answer
632 views
Adding an event or command to DataGridTextColumn
I am adding a Custom DataGridTextColumn that will allow me to fire an event when when ever the content is changed in this cell.
Please note:
I do not want to use a DataGridTemplateColumn with this ...
0
votes
1answer
116 views
WPF Reach to DataGridTextColumn's Binding info as string
I'm new at WPF. I have stuck somewhere in XAML. This XAML code is working:
<DataGridTextColumn Binding="{Binding Model.Name, UpdateSourceTrigger=PropertyChanged}">
<DataGridTextColumn....
0
votes
1answer
132 views
Binding a DataGridTextComun To DataGridComboBoxColumn.SelectedItem
Let me first explain what I want, I would like to have a datagrid that will have a ComboBox with lets say a list of companies. When I choose a company, I would like the cell(DataGridTextColumn) next ...
1
vote
1answer
474 views
Insert text programmatically at caret position in WPF DataGrid cell when shortcut is pressed
How do I insert text at caret position in DataGridTextColumn when the user press Alt+X?
This is the DataGrid
<DataGrid x:Name="TheGrid" SelectionUnit="Cell" ItemsSource="{Binding Soruce}" ...
2
votes
2answers
3k views
Add padding to DataGridTextColumn in WPF
I have the following DataGrid:
<DataGrid x:Name="RecodersSummary" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Top" BorderThickness ="1" IsReadOnly ="True" Loaded="...
0
votes
1answer
255 views
DatagridTextColumn with decimal value, allow no entry
Using .Net 4.6.
I have a DataGridTextColumn bound to a decimal? property. (I needed help from this link to get it to work at all.)
Is it possible to allow the user to enter no value? That is, the ...
0
votes
1answer
1k views
Setting value of datagridtextcolumn cell WPF application
Good day
I must be missing something really simple here; I have a datagrid with two combobox columns and a datagridtextcolumn. Once the user has selected a value for both of these comboboxes (a value ...
0
votes
1answer
609 views
How to set margin for DataGridTextColumn and text inside it?
i create a DataGrid:
<DataGrid x:Name="dataGrid"
AutoGenerateColumns="False"
Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
...
0
votes
0answers
249 views
Change StringFormat during Runtime
I have the following Scenario where I want to change the StringFormat of a DataGridTextColumn on runtime. On my DataGrid I have also a DataGridTemplate with a Button inside. When I press the Button I ...
0
votes
1answer
670 views
How to Retrieve Values from DataGridTextColumn based on KeyBinding in C# [duplicate]
I have a DataGrid to list the MobileInfo collection. The DataGrid is configured with SelectionUnit="FullRow". If I click the any row then it selects the entire row with additionally it points the cell ...
1
vote
0answers
540 views
How to Sort WPF MultiBinding DataGridTextColumn based on the MultiBinding?
I want to Sort the DataGridTextColumn based on the Multibinding Values - The Text Column is bind with both Date and Time, so the sorting operation should be done based on DateTime.
The XMAL Source ...
0
votes
1answer
941 views
DataTrigger for DataGridColumnHeader based on DataGridTextColumn Header Property
I'm having filter Icon style implemented for the Target Type = DataGridColumnHeader and I attached the Style in DataGrid. Now The Filter Icon should show based on DataGridTextColumn Header Property. ...
0
votes
0answers
96 views
how to get value from fallbackvalue?
I have the following DataGridTextColumn:
<DataGridTextColumn Header="Example" IsReadOnly="True"
Binding="{Binding Ex, FallbackValue='ExampleValue'}" />
the itemSource ...
1
vote
1answer
57 views
gwt text column code not running
I'm building a Datagrid that contains recipe data contained in a "Recipes" object. Using TextColumns to fill out the table, but the code where I'm actually creating the columns doesn't seem to run:
...
0
votes
1answer
1k views
Wpf DataGridTextColumn With Element Style And ReadOnly
I need to disable editing on specific column based on a trigger ,but is not working.
<DataGridTextColumn Binding="{Binding Qty,UpdateSourceTrigger=PropertyChanged}" Header="QTY" Width="100">
...
0
votes
2answers
11k views
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 ...
3
votes
2answers
763 views
WPF, create Custom DataGridTextColumn to Prevent unwanted Character
i newbie to WPF,
i want to prevent user to input character, eg. character "-", so
i created custom DataGridTextColumn with following code :
public class DataGridNumericColumn : DataGridTextColumn
{
...
0
votes
1answer
28 views
How to hide left part instead of right part of a WPF datagrid column when resize it?
I have a DataGridTextColumn that show list of batch download URLs. These URLs have same begin part, only different at the end. They are too long to display, so I resize this column by drag column ...
1
vote
2answers
2k views
DataGridTextColumn's “TextBox” styling isn't consistent with its “TextBlock”
I'm having trouble styling the TextBox that's used for editing in a DataGridTextColumn. A bit of background on this column:
it's bound to a property called 'Top' (numeric value)
there is a property ...
0
votes
1answer
111 views
How to unit test a custom DataGridTextColumn implementation
I subclassed DataGridTextColumn to implement an editable DataGridColumn for numeric values. Because the logic inside got somewhat complex, I'd like to unit test the implementation with NUnit. However, ...
0
votes
1answer
31 views
EditItem is not allowd for this view
<DataGrid x:Name="dataGrid"
ItemsSource="{Binding}"
AutoGenerateColumns="False"
IsReadOnly='False'
Margin="1,3,6,3"
Height='135'
...
1
vote
0answers
127 views
WPF DataGridColumnWidth doesn't work well when PrintVisual
I have a ucReceipt.xml that looks fine in design mode or even it looks good while Opening the window http://prntscr.com/5xl11h:
<DataGrid AutoGenerateColumns="False" ItemsSource="{Binding ...