问题标签 [datagridtextcolumn]
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.
wpf - WPF MVVM: Access DataGridTextColumn Cells
I have a dynamically DataGrid generated from a DataGridTextColumn collection. Is there any way to access the cells of the column directly from the DataGridTextColumn object?
Thanks!
wpf - 在 DataGridTextColumn 中为 TextBlock 创建样式
我想创建一个全局样式,将a或 a内的所有控件设置VerticalAlignment
为。Center
TextBlock
DataGrid
DataGridTextColumn
我不想将以下内容复制到每个中DataGridTextColumn
,因为它感觉重复。
我尝试了类似以下的方法,但它不起作用,因为DataGridTextColumn
它不继承自FrameworkElement
or FrameworkContentElement
。DataGrid
本身可以,但我尝试的任何进一步包装都会导致错误:
silverlight - 如何控制 DataGridTextColumn 的可见性
我这样命名了两列
我想动态显示这两列...
当我像这样在 CS 文件中编码时
它给了我NullReferenceException ...
请帮我 :(
附言。请原谅我的英语很差...
wpf - DataGridTextColumn 绑定到不同的 DataContext
我需要将 DataGridTextColumn 绑定到不同的 DataContext,我知道这是可能的,因为我在 DaatGridComboBox 中正确执行了此操作。我现在的代码是
我做错了什么?
---- 在绑定代理上 --
我已经在文章中设置了 BindingProxy 类。有这个
但是,为什么它会知道元素“名称”?
干杯
wpf - DataGridTextColumn 获取 DataContext 属性
嗨,在 DataGridTextColumn 我绑定到一个新的 DataContext 工作
但是,文本框说“(集合)”所以有没有办法在集合中正确显示?
在 DataGridComboBox 中,您声明:
但是您在 DataGridTextColumn 中没有此属性。
谢谢
c# - 从代码隐藏格式化 DataGridTextColumn
也许,我想,事情太简单了。我有一个数据网格,从后面的代码中动态添加列。这行得通。然后我有整数值的列,我希望在列中看到右对齐,但它失败了。我的代码是:
最后我有类似的东西:
使用 textC.Binding.String.Format 的问题是:(首先:似乎 stringFormat-LIne 正确地重载了前一行)
格式“0”给出一个整数“1”“2”,这是正确的。
格式“00000”给出“00001”“00002”“00003”,这对于字符串格式是正确的,但不是我想要的
但:
格式 "######" 也给出 "1" "2" .. 等等(左对齐,没有前导空格)
由于格式规则,我本来期望(或希望),##### 是所描述的占位符,结果是 "bbbb1" , "bbbb2" 右对齐。(b 在这里表示空白!)
因此,Binding 似乎可以正确处理“00000”格式,但不能正确处理“######”格式。有人对此想法有任何想法或经验吗?(我在互联网上找到的所有其他绑定要复杂得多)
wpf - WPF 中 DataGridTextColumn 的可重用样式
我在 WPF 应用程序中设置了 DataGrid,并创建了保存在资源字典中的可重用样式。
但是我不确定如何为构成数据网格的元素设置可重用样式。
例如,现在我为 DataGridTextColumn 设置了以下样式,如下所示:
但是,我不想为我的项目中的每一列粘贴此代码,并且我不确定如何在我的样式资源字典中将其设置为可重用代码,我可以参考它来实现我在所有列上需要的单元格填充
c# - 在后面的代码中使用 Textblox 样式从 DataGridTextColumn 获取文本
我目前正在支持一个项目,并且我收到了一份更改数据网格单元验证的工作,以使他们插入的文本块的输入仅为 50 个字符。
我现在已经获得了 datagrid gotfocus() 事件,并检查了每个 DataGridTextColumn 的标题,如果正确的标题获得焦点,我为该列创建一个 Key_Down 事件。
在 Key_Down 事件中,我想测试当前字符串的长度,如果超过 50,我希望文本框不再添加到字符串中。但我的问题是,我没有从 DataGridTextColumn 获取文本。这是我的代码:
XAML
到目前为止我背后的代码
图片
所以我需要知道如何获取我为本专栏输入的文字?
任何帮助都是极好的 :)
谢谢。
c# - DateGridTextColumn 禁用空值
CompositeCollection
我有一个绑定了4的 DataGridTextColumnObservableCollection
之一DataGridTextColumn
,像这样绑定:
哪里 cmpc 是我的CompositeCollection
,哪里 Ligne 不能得到一个空值。问题,我在这个屏幕截图中采用了很多空值:http ://www.zimagez.com/zimage/compositecollection.php
如何忽略它具有空值的每一行?IsNullAble = false
是否存在类似的东西DataGridTextColumn
?
c# - 在 DataGridTextColumn 上添加工具提示
我有一个带有一些 DataGridTextColumn 的 DataGrid,如下所示:
当鼠标悬停在我的 DataGridTextColumn 上时,我想创建一个弹出窗口LibelleTOTM
。为此,我做了:
我在互联网上找到了这个解决方案,但它不适用于我的解决方案。我已经根据我的情况对此进行了调整,但可能还不够……当鼠标悬停在 LibelleTOTM 上时,什么也没有发生。错了TargetType
,我不能这样绑定自己吗?我想用 DataGridTextColumn 的值打开一个弹出窗口,所以发送我们ToolTip
在Binding="{Binding Path=LibelleTotm}"
<DataGridTextColumn x:Name="LibelleTOTM" Width="*" Binding="{Binding Path=LibelleTotm}" Header="Libellé TOTM">
如果有人知道那里缺少什么,出了什么问题,我该怎么做才能执行此操作?
提前致谢。
弗洛。