问题标签 [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.

0 投票
2 回答
167 浏览

vb.net - 变量“详细信息”在被赋值之前使用。

变量details在被赋值之前被使用。有什么问题details

0 投票
1 回答
343 浏览

c# - 从显示 RowDetails 中排除 DataGrid 列

我通过编写一个小工具来自学 WPF、LINQ 和 MVVM,以解析 CME XML 配置文件,如当前的生产配置。我在显示通道的 DataGrid 中添加了一个带有复选框的 DataGridTemplateColumn,以便我可以选择一些我感兴趣的通道并过滤掉其余的通道。问题是当我单击复选框时,会显示 RowDetails。

如果单击任何其他列,如何防止单击触发 RowDetails 的显示,同时仍然具有“VisibleWhenSelected”行为?我需要自己处理 RowDetails 的可见性还是有更简单的方法?

以下是添加了 ToggleButton 的更新代码,如下所示,以防万一它对其他人有用:

这里是模板

这是C#中的代码

0 投票
1 回答
2280 浏览

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):

0 投票
1 回答
500 浏览

c# - 展开多行详细信息时数据网格变慢

所以我有一个数据网格,其内容都是从多个 Web 请求中填充的。展开后,rowdetails 还会发送多个 Web 请求以填充更多信息。

在行详细信息中,有一个 Listview、一个列表框、一些布局元素和一些文本块。

添加初始数据后,数据网格快速滚动,但如果您展开 4-5 行详细信息,突然滚动断断续续,几乎不存在。

这是一个已知的问题?

我可以为每个项目重复使用相同的可视 rowdetails 元素吗?它仅在选择时显示,并且所有检索到的数据都被缓存,因此不需要在已查看的元素上重新加载

行不会一次展开超过一个... 行详细信息仅在选择一个项目时显示,并且您一次只能选择一个。问题是在您选择了几个不同的项目并生成了行详细信息视觉对象后,它会变慢。

0 投票
1 回答
951 浏览

wpf - 在 WPF 和 XAML 中,如何让行详细信息的列在跳过多个列后动态更改以在父行下对齐?

我的模型如下所示:

在此处输入图像描述

我想要实现的是,不是让行详细信息以默认方式显示,而是希望它们与父网格列对齐显示。我希望详细信息网格跳过前 3 列(为空白),然后将详细信息与父行的“街道名称”、“街道编号”列对齐。

如果有人能指出我应该研究实现这一目标的属性,那就太好了。

更新:我取得了一些进展,但仍然没有完全通过。我的行显示了我想要的方式,但是在调整列大小时它会中断。我没有发现任何与 Column width changed 或类似的事件相关来编写代码来调整宽度。它是如何在 WPF 中完成的?另外,有没有更好的方法来实现这一点?在此处输入图像描述

xml代码是:

后面的代码是:

0 投票
1 回答
463 浏览

c# - 在 XAML 中向 DataGrid 添加行详细信息

我制作了一个 wpf DataGrid,它从文件名列表及其分数中调用。网格工作得很好,现在我试图让它可供用户单击一行,它会显示文件内容本身(文本文件)。文本字符串非常大,因此我不希望它成为列表的属性。相反,我希望文件路径成为属性,并且每当我单击一行时,流媒体都会读取文件。

我正在用 c# 编码。到目前为止,这是我的(部分)代码:

和我的 XAML:

谢谢,对不起,如果我不够清楚

0 投票
1 回答
38 浏览

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?

0 投票
1 回答
106 浏览

c# - 粮食计划署数据网格行详细信息垂直滚动条不起作用

我有一个带有 rowdetails 的数据网格(也是一个数据网格)。当我展开行时,垂直滚动条不显示。请看下面的截图:

滚动条不起作用

下面是我的数据网格的 xmal 代码

我试图将 VerticalScrollBarVisibility 设置为其他值,例如 auto 等。没有任何效果。有谁知道为什么会这样?如果有解决方案?

谢谢

0 投票
0 回答
154 浏览

wpf - WPF 绑定和反射

我正在使用 On AutoGeneratingColumns 生成一个 DataGrid。整个过程是高度动态的并且基于元数据。DataGrid 中显示的每条记录(行)在技术上都是一个类,它派生自一个基类。

基类包含一个属性,该属性返回每条记录显示的列的列表。

就像是

现在,我想使用 RowDetails 编辑记录的每个属性的值。

RowDetails 显示在 ListBox 中,该 ListBox 将其 ItemsSource 绑定到之前提到的 bas 类的属性。

显示一切都很好,但是当我改变一个值时,什么都没有达到设置方法。

文本框看起来像这样

我究竟做错了什么?

0 投票
1 回答
92 浏览

c# - RowDoubleClick 上的 DataGrid RowDetails 可见性

在我的 Datagrid xaml 中,我将 rowdetailsvisibilitymode 设置为折叠。

然后我在 RowDoubleClick 上创建了一个事件,以在双击该行时折叠和展开该行的详细信息:

现在我想在选择新行时折叠这些详细信息......我想在选择时模仿可见,但使用双击。

我的想法是:如果可能的话;选择新行时,行的详细信息会折叠,但新行在双击之前不会展开。第二次双击也应该能够折叠当前选定行的详细信息。