I have a DataGrid with DataGridTemplateColumn.
The DataGridTemplateColumn contains a button and TextBlock.
I want that pressing the button will clear the textBlock's text.
How do I do that ?
XAML:
I have a form, it has a grid.
I autogenerate the columns and tweak them as required:
if (e.PropertyName == "id")
{
System.Windows.Style style = new Style(typeof(DataGridCell));
style.Setters.Add(new…
In this hypothetical example, imagine I have an object FooSet that has five properties Foo1, Foo2, Foo3 Foo4 and Foo5 all of which are type Foo which itself has several properties. Finally, I have a DataTemplate called FooTemplate that knows how to…
Context: a C# 4.0 WPF application with a datagrid that has one TemplateColumn showing a progress bar.
How can one get the grid to only display the progress bar for certain items based on a condition?
Maybe listening to the events and hiding the…
I want to add a combo Box in table cell to provide drag n drop option LWUIT.
I have used this option for it ..
private String strCmbBox[] = { "1", "2", "3", "4" };
ComboBox comboRdoBox = new ComboBox(strCmbBox);
…
i'm trying to create a DataGrid with a column of checkboxes. On that CheckBox-column's header, i'd like to have a "check/uncheck all"-type of checkbox.
App is using WPF, .NET 4 and MVVM Light.
Here's the code:
XAML:
I would think that this would be incredibly simple, but I've searched all over and can't seem to find an answer. I have a DataGridTemplateColumn that I want to use to display a value that isn't in the DataContext of the DataGrid. I.e. I have an…
EDIT (clarification of requirements)
I have a DataGrid as shown below. The values in the "Field Name To Store Old EmpNo" column change based on the value selected in "New EmpNo Rule" column. To accommodate this, each item in the DataGrid…
I've got kind of a conceptual question. I am in the process of wrapping some statistics classes I wrote into WPF.
For that I have two DataGrid(-Views, currently in WinForms). In one DataGrid each row represents a column in the other. There I can…
I want to center the header on a Silverlight DataGridTemplateColumn. The following code gets me most of the way there:
DataGridTemplateColumn column = new DataGridTemplateColumn();
column.CellTemplate = Resources[templateName] as…
I am using a DataGrid and the ItemSource is Bound to a list of strings.
The problem is that the sorting is not working.
The header is enabled and can be clicked but the data is not sorted.
I am able to center the header without any problems but the cell with the checbox... if I set it to HorizontalAlignment=Center it shows all the way in the left, if I change it to HorizontalContentAlignemnt=Center it shows all the way to the right...…
Ive got an ObservableCollection list, which is bound to a combobox. This combobox is in a datatemplate which is inside a 'DataGridTemplateColumn'.
When the datagrid is displayed (with all the rows), the column displaying this combobox works…
I have a DataGrid bound to a collection of Employees. Employee class has an EmployeeCountry of type Country. Country type consists of CountryId and CountryName.
I have the following XAML: