Questions tagged [datagridcolumn]

A class that presents a data column in a datagrid.

Learn more about datagridcolumn at MSDN.

128 questions
37
votes
5 answers

WPF - DataGrid Column with Width="*", but MinWidth to Fit Contents

What would be the best/right way to have a set of DataGrid columns have proportional width (Width="\*"), but to have their minimum width be at least the width of their content? At the moment, if I use Width="*", then the columns stay exactly…
Andy T
  • 1,901
  • 7
  • 20
  • 24
14
votes
5 answers

Unable to set DataGridColumn's ToolTip

I tried the following: And I don't see any tool tip. Any ideas? Is it even implemented?
Shimmy Weitzhandler
  • 101,809
  • 122
  • 424
  • 632
13
votes
6 answers

WPF DataGrid Sync Column Widths

I've got two WPF Toolkit DataGrids, I'd like so that when the user resizes the first column in the first grid, it resizes the first column in the second grid. I've tried binding the width of the DataGridColumn in the second grid to the appropriate…
viggity
  • 15,039
  • 7
  • 88
  • 96
8
votes
2 answers

How to get DataGridColumnHeader from DataGridColumn?

My code is as follows: void mainDataContextObj_CutSelectedColumnEvent(string columnId) { IList columns = dg.Columns; for(int i=2; i
7
votes
4 answers

Automatically resize width of DataGridCoulmn/AdvancedDataGridColumn to fit content

I want that the DataGridColumn or AdvancedDataGridColumn would automatically resize it's width so as to fit the content within.. I'm new to flex. I want to implement something like HTML tables. The Data Rendered is simple Text. Some Rows have little…
Ravish
  • 2,428
  • 2
  • 18
  • 24
7
votes
1 answer

WPF Datagrid columns width as percentage of Datagrid ActualWidth

I've spent several hours looking at this with no results. I simply want to have a DataGrid with X number of columns that maintains its relative width to the Grid itself. So, for example: Col 1: 10% Col 2: 10% Col 3: 10% I have set up a style that…
Aibynn
  • 115
  • 1
  • 8
6
votes
2 answers

cannot find Name of DataGridColumn programmatically

I found the Columns collection in my datagrid, and was hoping to iterate through it to find a certain column Name. However, I can't figure out how to address the x:Name attribute of the column. This xaml illustrates my problem with a…
Daniel R
  • 87
  • 1
  • 1
  • 8
6
votes
2 answers

Why can't I use DynamicResource with DataGridColumn.CellStyle

So, for example I have some MVVM WPF application with simple model: public class MyObject { public string F1 { get; set; } public string F2 { get; set; } } and simple view model that creates 3 rows: public class MyViewModel { public…
Envilogger
  • 300
  • 2
  • 8
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
4
votes
4 answers

WPF DataGridTextColumn Tooltip

Is there a way to add tool tip to DataGridColumn header and still retain the sorting functionality. The below code doesnt work(It doesnt display the tooltip)
developer
  • 5,178
  • 11
  • 47
  • 72
4
votes
2 answers

Binding DataGrid Column DataTemplate to Attached Property

I am trying to customize a DataGridColumnHeader to show multiple text fields instead of showing only the header text provided by DataGridColumn.Header property. If i didn't miss something, i just have to create a DataTemplate and bind to the…
LaWi
  • 71
  • 1
  • 1
  • 6
4
votes
0 answers

DataGrid Column not resizing when printing

I have an application that fetch data from sensor and then outputs Graphs and Datagrid from that data. What worked : I was generating a report with usercontrol that were inserted in a fixedPage that were shown in a FixedDocument with the help of a…
malavv
  • 553
  • 1
  • 5
  • 14
4
votes
1 answer

Tag Property in WPF DataGrid Column

I need to save an string inside a Datagrid Column which differs from the Header. This is needed because I generate a Datagrid dynamically and want to translate the Column Headers while generating them. Then I bind the whole XAML to a…
Johannes Wanzek
  • 2,825
  • 2
  • 29
  • 47
3
votes
2 answers

How do i make some of my datagridcolumns non editable or readonly if my flex datagrid is editable

How do i make some of my datagridcolumns non editable or readonly if my flex datagrid is editable?
Linda
  • 31
  • 1
  • 2
3
votes
2 answers

WPF MVVM DataGridColumnHeader DisplayName

I got an DataGrid in MVVM which´s ItemsSource is bound to a Custom Model. The properties in this model are named like their equivalent in the database. For example this: public string StapelStatus_Txt { get { return…
Robert Nagel
  • 149
  • 14
1
2 3
8 9