I've a DataGrid and it has a DataGridCheckBox column. And I need to present the check box like this in all the rows of DataGrid:
And following is the XAML and corresponding code I've:
How come is the ActualWidth of a DataGridColumn is not affected by changing the value of its Width property but it is when I change the value of its MinWidth? In other words how does ActualWidth get computed or changed ?
I have a Datagrid with three columns.
I want the second column readonly if the value of first column is not null
I tried with a converter but there's something wrong.
Any ideas why?
I am aware that as DataGrid columns aren't part of the Visual Tree, you can't bind the visibility property of the columns directly to a boolean property in your VM. You have to do it another way. Below is the way I have done it:
public class…
I have a datagrid whose column properties have to be changed programmatically in code behind for this I use the event
AutoGeneratingColumn="Datagrid_AutoGeneratingColumn"
on which I do:
private void Datagrid_AutoGeneratingColumn(object sender,…
I am using Visual Studion 2015, .NET Framework 4.5.2, working with WPF, and want to assign the content of an imported CSV-file in a simple way to a DataGrid object, which is described here:
(...)
I want to get a datagrid edited cell's column name.
private void CellEditEnding(object sender, DataGridCellEditEndingEventArgs e)
{
var editedTextbox = e.EditingElement as TextBox;
if (editedTextbox != null)
…
I'm trying to use cellclick on a grid where based on a certain column clicked, I want to run some operations. But every time, it returns a wrong column i.e. if I click on column 0 (first col), it returns the next column.
cellclick: function(view,…
I have an Image in my DataGrid. Its purpose is to play and stop an audio, so I need to change the image source from the "Play" image to the "Stop" image every time I click on it.
I've already accomplished that with the next code:
I have a Datagrid with some DataGridTemplateColumns. One of them is for the costs (see code below). The column heading is Costs. Now I want a image at the right side of the heading Costs. How can I do that?
I am trying to setup a DatePicker DataGrid column in the code. This column is used with different DataGrids, each displaying different types of objects. From this post I came up with the following code, which works ok:
public DataGridColumn…
I have a datagrid that uses an array of objects as the data provider. The objects are essentially key/value pairs:
{ foo:"something"}
{ bar:"hello"}
{ caca:"lorem"}
The datagrid has 2 columns. The first column is the key and the second column is…
Not sure how to go about this. I am trying to set-up a DataGridHyperlinkColumn in the code-behind so that all the links point to the same URI but each has a different attribute value.
Here is what I have so far:
DataGridHyperlinkColumn dgCol = new…