问题标签 [datagridcolumn]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
77 浏览

windows - Windows Clasic中的wpf DataGridColumn宽度

我有许多列的 DataGrid,最小化已用空间至关重要。此 DataGrid 的数据非常随机,somtimes 列可以为空,somtimes 填充大量数字,因此我决定不指定列宽。我正在使用 Windows 7 Basic 桌面设置(左图),它看起来不错,但我的一些用户使用 Windows Clasic 桌面设置(右图)并且列的宽度是不必要的。

“不允许新用户发布图片” - 所以没有图片

左图:带有标题“A”的空列,宽度为5mm,带有嵌入复选框的列,宽度为6mm 右图:带有标题“A”的空列,宽度为6mm,带有嵌入复选框的列,宽度为8mm

对于我的 20 个专栏来说,它让我退出了一个地方:(

我可以对 DataGridColumn 宽度做些什么以使其在 Windows Classic 中更紧?

0 投票
2 回答
1047 浏览

actionscript-3 - flex:如何对 GridColumn 进行排序

我想对我的 gridcolumn 进行排序。这是我的 sortCompareFunction 代码:

和数据网格:

它不起作用。我在列标题中看不到箭头,并且任何内容都已排序。提前感谢您的帮助!

好的,通过用 Arraycollection 替换 AsyncListView 来解决:

没有 sortCompareFunction。

0 投票
2 回答
479 浏览

apache-flex - Flex 4 DataGridColumn:函数绑定到 headerText 不起作用

我有一个大问题来绑定这个方法:

像这样:

装订接缝根本没有被执行。(认为​​,因为 trace() 没有被调用,我已经调试过了)

但同样的作品在这里完美:

有人知道问题是什么吗?

注意:我读了这篇文章,我认为这是同样的问题,但由于任何原因它对我不起作用:

0 投票
0 回答
10129 浏览

c# - 如何动态调整 WPF DataGrid 列的宽度?

我的窗口中有一个 DataGrid,我需要自动调整列的宽度以适应内容。但我有一个障碍:

  • 如果他的内容比他的header小,以header的大小为准;
  • 他的内容由一个绑定自动更新,链接到一个文本框。所以......当用户关注另一个字段时,表示该字段的列将更新。当最新内容大于以前的数据时,它已经发生了。
  • 我正在使用 MVVM,这个组件是 DataGrid 的 UserControl 扩展。我不能使用比我们在代码隐藏中拥有的一些资源,但我可以使用(这不是最好的方法)MVVM 绑定来调整它的大小。我真的很想做一个通用的解决方案。

我会很感激任何帮助。

此致,

古斯塔沃。

0 投票
2 回答
2283 浏览

wpf - WPF MVVM DataGridColumnHeader DisplayName

我在 MVVM 中有一个 DataGrid,它的 ItemsSource 绑定到一个自定义模型。

此模型中的属性命名为与其在数据库中的等价物相同。例如这个:

是否有可能(不重命名属性)为数据网格声明另一个显示名称?我认为数据注释“DisplayName”会有所帮助……但事实并非如此。

有人有想法吗?:)

亲切的问候

0 投票
0 回答
545 浏览

wpf - 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 DocumentViewer.

What I then did : In order to facilitate many things, enabling text search, pre-generating the report, ..., I decided to convert my FixedDocument in a XpsDocument and putting this in the DocumentViewer.

My Problem : For some reason, everything was unchanged by the conversion except my DataGrid columns. I am manualy inserting my column in Xaml and each have a Width of 1*. But the result I am getting is as if it were completely ignoring the resize. It's not even resizing properly to the content.

What fixes it : When I put a fixed Width it is respected in the viewer.

Code :

Style :

Xaml :

0 投票
2 回答
335 浏览

wpf - WPF - 只有 DataGridColumn 中的特定单元格有一个复选框......有可能吗?

我的客户要求我们有一个带有 DataGrid 的表单,它从数据库中实际数据的角度出发。

下面是我的数据库的(简化)外观。

以下是我被要求创建的内容。

flag 列应该是 0 或 1,所以我希望该列是 a DataGridCheckBoxColumn,但它是旋转的!当然,我可以(轻松地)让单元格在验证过程中只接受 1 或 0,但是,我仍然想知道是否可以让列中的指定单元格具有CheckBox.

0 投票
1 回答
1159 浏览

c# - 绑定列表在带有 caliburn.micro 的数据网格列中

我的课是这样的:

这个 Ean 类:

我的数据网格是:

他是 ViewModel 的一员:

在 BarCodes 列中写入(集合)!而不是条形码。为什么?如何查看列中的条码列表?谢谢..

0 投票
1 回答
1119 浏览

extjs - ExtJS - 将列标题拖到其他网格

我需要保留重新排序列的默认功能,并添加将列放入第二个网格的可能性,在最后一个包含第一个网格的列的列表中构建。

我希望已经清楚了。

0 投票
1 回答
663 浏览

wpf - 可绑定的动态 DataGrid 列

这是我的 ViewModel 类:

DataGrid 扩展类:

和我的 XAML 代码:

我想要实现的一切都是添加 CellTemplate:

我认为最简单的方法是再添加一个依赖属性来获取单元格模板。然后,如果存在,请在填充 DataGrid 时创建 DataGridTemplateColumn 而不是 DataGridTextColumn,但我在将 CellTemplate TextBlock 绑定到 ColumnBindingPath 依赖属性时遇到了一点问题。请帮忙 ...