如何在DataGrid中查看数据是否已更改 [英] how to see if data changed in DataGrid

查看:73
本文介绍了如何在DataGrid中查看数据是否已更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




如何在DataGrid中查看用户是否更改了数据,以便我可以询问

他保存更改或不是吗?


谢谢,


彼得

Hi,

How can I see if the Data is changed by the user in my DataGrid so I can ask
him to save the changes or not?

Thanks,

Pieter

推荐答案

Pieter,


您可以检查底层数据表是否有变化。


Unluckely没有方法datatable.haschanges。


所以你应该使用伪造的解决方法


myNewTable作为新的datatable = datasource.table.getchanges

而不是测试是否那些充满了行。


我希望这能给出一个想法吗?


Cor
Pieter,

You can check if the underlaying datatable has changes.

Unluckely there is no method datatable.haschanges.

So you should use a workaround something as pseudo

myNewTable as new datatable = datasource.table.getchanges
And than test if that is filled with rows.

I hope that this gives an idea?

Cor

嗯,谢谢,这似乎有用。

但是如果我的DataGrid中有2个绑定的DataTables,我不会只做支票
目前在DataView中的记录?


Pieter


" Cor Ligthert" <无********** @ planet.nl>在消息中写道

news:ev ************** @ TK2MSFTNGP11.phx.gbl ...
Hm thanks, that seems to work.
But what if I have 2 bound DataTables in my DataGrid, and I wan''t only do
the check on the records that are currently in the DataView?

Pieter

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:ev**************@TK2MSFTNGP11.phx.gbl...
Pieter,
您可以检查底层数据表是否有变化。

Unluckely没有方法datatable.haschanges。

所以你应该使用一个变通方法作为伪

myNewTable作为新的datatable = datasource.table.getchanges
而不是测试是否填充了行。

我希望这给出了一个想法?

Pieter,

You can check if the underlaying datatable has changes.

Unluckely there is no method datatable.haschanges.

So you should use a workaround something as pseudo

myNewTable as new datatable = datasource.table.getchanges
And than test if that is filled with rows.

I hope that this gives an idea?

Cor



Pieter,


数据视图还有一个表属性告诉哪个表格

引用


Cor
Pieter,

The dataview has as well a table property which tells which table it
references

Cor
嗯谢谢,这似乎有效。
Hm thanks, that seems to work.
But what if I have 2 bound DataTables in my DataGrid, and I wan''t only do
the check on the records that are currently in the DataView?



这篇关于如何在DataGrid中查看数据是否已更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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