DevEx preSS WPF GridControl动态列和行 [英] DevExpress WPF GridControl with dynamic columns and rows

查看:934
本文介绍了DevEx preSS WPF GridControl动态列和行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正与一个DevEx preSS 14.1 GridControl WPF的,它必须绑定到一个动态源。我们不知道在设计时间列或行的数目,所以这必须计算的飞行。

在执行源可以被改变,增加更多的行或列,或二者(我可以有具有3列和5行,以及第六行,4列的表可以插入,增加一个新列模型为previous行)。

空数据

我是用一个数据表作为的ItemsSource网格,但它在设计时只加载数据插入。如果在运行应用程序,我添加列,电网不会因某种原因更新。

有没有能满足这需要?一个可观察的对象。

解决方案

它使用code隐藏(不MVVM),也许你已经尝试过,但你试过显式调用 myGrid。 RefreshData()在.xaml.cs文件?有会出现一些钩UPS,以得到它在正确的时间呼叫根据数​​据的变化,但它可能至少可以帮助你缩小的问题,如果它有助于与否。

DevEx preSS支持答案这里可以帮助也。

从数据表更改为一个ObservableCollection也可以做的伎俩:看这个 <。 / P>

顺便说一句,我发现DevEx preSS的支持票系统是非常有帮助的;他们似乎在回应〜24小时的议题和问题。如果你仍然能够得到您的许可和放大器的支持;不解决这个问题,我仍然会问他们同样的问题这里

I'm working with a DevExpress 14.1 GridControl on WPF, which must bind to a dynamic source. We don't know the number of columns or rows on design time, so this must be calculated on the fly.

The source may be changed while executing, adding more rows, or columns, or BOTH (I could have a table with 3 columns and 5 rows, and a 6th row with 4 columns could be inserted, adding a new column to the model with empty data for the previous rows).

I was using a DataTable as ItemsSource for the grid, but it will only load data inserted on design time. If I add columns while running the app, the grid wont update for some reason.

Is there an observable object that can satisfy this needs?

解决方案

It's using code-behind (not MVVM) and maybe you already tried it, but have you tried explicitly calling myGrid.RefreshData() in your .xaml.cs file? There'd be some hook-ups to get it to call at the right times depending on your data changes, but it might at least help you narrow in on the problem if it helps or not.

DevExpress support answer here may help also.

Changing from a DataTable to an ObservableCollection may also do the trick: see this.

BTW, I've found DevExpress's support ticket system to be very helpful; they seem to respond within ~24 hours for issues and questions. If you're still able to get support for your license & can't solve it still, I'd ask them the same question here.

这篇关于DevEx preSS WPF GridControl动态列和行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆