问题标签 [rowdetails]
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.
vb.net - 变量“详细信息”在被赋值之前使用。
变量details
在被赋值之前被使用。有什么问题details
?
c# - 从显示 RowDetails 中排除 DataGrid 列
我通过编写一个小工具来自学 WPF、LINQ 和 MVVM,以解析 CME XML 配置文件,如当前的生产配置。我在显示通道的 DataGrid 中添加了一个带有复选框的 DataGridTemplateColumn,以便我可以选择一些我感兴趣的通道并过滤掉其余的通道。问题是当我单击复选框时,会显示 RowDetails。
如果单击任何其他列,如何防止单击触发 RowDetails 的显示,同时仍然具有“VisibleWhenSelected”行为?我需要自己处理 RowDetails 的可见性还是有更简单的方法?
以下是添加了 ToggleButton 的更新代码,如下所示,以防万一它对其他人有用:
这里是模板
这是C#中的代码
c# - How do I set mouse focus to a WPF datagrid's row details?
So I am using WPF and the MVVM pattern. I have my datagrid's ItemSource property bound to a collection of domain objects in my ViewModel. The datagrid also has a RowDetailsTemplate defined which helps me modify all of my properties on my domain object. I have the datagrid set up so it only allows a single row to be selected at a time.
In case you are wondering here is what my datagrid declaration looks like:
So you will also notice that the SelectedItem is also bound to a property in my ViewModel
Here is my problem: below my datagrid I have an 'add new record' button
which (inside the click event) executes my 'AddDetailCommand' in my ViewModel. The 'AddDetailCommand' simply creates a new domain object, adds it to the ViewModel's collection of domain objects and then sets the ViewModel's 'SelectedDetail' property to the newly created object. Then I call RaisePropertyChanged("FileMoverDetails") followed by RaisePropertyChanged("SelectedDetail").
This makes my datagrid select the newly created item and expand the datagrid's row details. My datagrid's row details has a lot of fields including ComboBoxes and TextBoxes. Which brings me to my real problem: when I left click once on one of my TextBoxes so that I can start typing it doesn't place focus in the text box and I have to click a second time before I can start typing. This happens with any control inside my row details though: I have to click once on any control and then click a second time before anything happens. This problem is only encountered if I click my 'add new record' button. Meaning if I select an already existing row in the datagrid then the focus is correct and I can click once on any row details control and it will work as expected.
For another example of the issue I am having, I have a 'remove record' button in the datagrid's row details which when activated removes the currently selected domain object from the datagrid's item collection. After clicking the 'Add new record' button I go and immediately click once on the 'remove record' button and nothing happens. But when I click a second time then the button works.
So what am I asking? After I click my 'add new record' button I want to be able to click once on my 'remove record' button and have its functionality activated without having to click another time.
.
.
Extra information:
I thought this was purely a focus issue so I ammended my 'add new record' button's Click event to set the focus to one of my datagrid's row details TextBox control after adding the new record:
Guess what happened? It set the keyboard focus into the TextBox like I expected it would (I can start typing immediately and it will place my typed text into the TextBox). But when I click once on a different TextBox or my 'Remove record' button or a different control (all of which are in the datagrid's row details) nothing happens! I have to then click a second time for the control to do what I expected only a single click to do.
Please help, I have tried so hard to get this to work and it is very frustrating. Even if you can't help I want to thank you for getting to this point in this description, I know it is very long.
Here is my View's XAML (well at least the relevant parts, I remove stuff and placed "..." in the places where stuff was removed):
c# - 展开多行详细信息时数据网格变慢
所以我有一个数据网格,其内容都是从多个 Web 请求中填充的。展开后,rowdetails 还会发送多个 Web 请求以填充更多信息。
在行详细信息中,有一个 Listview、一个列表框、一些布局元素和一些文本块。
添加初始数据后,数据网格快速滚动,但如果您展开 4-5 行详细信息,突然滚动断断续续,几乎不存在。
这是一个已知的问题?
我可以为每个项目重复使用相同的可视 rowdetails 元素吗?它仅在选择时显示,并且所有检索到的数据都被缓存,因此不需要在已查看的元素上重新加载
行不会一次展开超过一个... 行详细信息仅在选择一个项目时显示,并且您一次只能选择一个。问题是在您选择了几个不同的项目并生成了行详细信息视觉对象后,它会变慢。
c# - 在 XAML 中向 DataGrid 添加行详细信息
我制作了一个 wpf DataGrid,它从文件名列表及其分数中调用。网格工作得很好,现在我试图让它可供用户单击一行,它会显示文件内容本身(文本文件)。文本字符串非常大,因此我不希望它成为列表的属性。相反,我希望文件路径成为属性,并且每当我单击一行时,流媒体都会读取文件。
我正在用 c# 编码。到目前为止,这是我的(部分)代码:
和我的 XAML:
谢谢,对不起,如果我不够清楚
c# - Setting DataGridRow RowDetails visibility after toggling between TabItems
I have a TabControl
, in each TabItem
there is a DataGrid
. Each DataGridRow
has a button on the DataGridRowHeader
, which expands and collapses the RowDetails
.
As I use the row details expansion functionality, so have set the VirtualizingPanel ScrollUnit to Pixel, so scrolling is a bit more natural.
The program captures which rows have been expanded in an ObservableCollection<int>
which holds the row index to expand.
When I toggle to a new TabItem
and back to the original TabItem
, it loses which rows have been expanded.
Upon the DataContext
being changed, I'd like to use the ObservableCollection
to reset the expanded rows. I have tried this in the DataGrid
DataContextChanged
event.
However, it doesn't like doing this on rows that are not currently in the VirtualizingPanel
.
How can I accomplish this?
Should I just do the expand the currently virtualized rows?
Should the DataGrid
ScrollViewer
be manipulated programmatically as well? How can I account for the rows not visible in the ScrollViewer
?
Is there another object, other the DataGridRow
that I should be setting the RowDetails
Visibility
to?
wpf - WPF 绑定和反射
我正在使用 On AutoGeneratingColumns 生成一个 DataGrid。整个过程是高度动态的并且基于元数据。DataGrid 中显示的每条记录(行)在技术上都是一个类,它派生自一个基类。
基类包含一个属性,该属性返回每条记录显示的列的列表。
就像是
现在,我想使用 RowDetails 编辑记录的每个属性的值。
RowDetails 显示在 ListBox 中,该 ListBox 将其 ItemsSource 绑定到之前提到的 bas 类的属性。
显示一切都很好,但是当我改变一个值时,什么都没有达到设置方法。
文本框看起来像这样
我究竟做错了什么?
c# - RowDoubleClick 上的 DataGrid RowDetails 可见性
在我的 Datagrid xaml 中,我将 rowdetailsvisibilitymode 设置为折叠。
然后我在 RowDoubleClick 上创建了一个事件,以在双击该行时折叠和展开该行的详细信息:
现在我想在选择新行时折叠这些详细信息......我想在选择时模仿可见,但使用双击。
我的想法是:如果可能的话;选择新行时,行的详细信息会折叠,但新行在双击之前不会展开。第二次双击也应该能够折叠当前选定行的详细信息。