从DataGrid添加新行到数据集 [英] Add new row from DataGrid to dataset

查看:76
本文介绍了从DataGrid添加新行到数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有dataGrid,数据源是数据集。当我编辑ne行时,我有

点击下一行(或前一行)到这(新)行将添加到

数据集中。这是问题,如果用户添加新行并立即保存

数据集。在这种情况下,新行不会添加到数据集中。


任何消化?


Thanx

Honza

Hi All,
I have dataGrid and as its datasource is dataset. When I edit ne row, I have
to click on the next (or previous) row to this (new)row will be add into the
dataset. That is problem , if user add new row and immediate save the
dataset. in this scenario the new row don''t add into the dataset.

Any sugestion?

Thanx

Honza

推荐答案

Jan,


与之相关的最常见问题之一ADONET。


数据网格中的数据在行更改后被下推到数据源。

你可以强制使用(这里显示的是第一个表)


BindingContext(ds.Tables [0])。EndCurrentEdit();


我希望这有帮助


Cor
Jan,

One of the most asked questions in relation to ADONET.

The data in the datagrid is pushed down to the datasource after a rowchange.
You can force that with (here showed for the first table)

BindingContext(ds.Tables[0]).EndCurrentEdit();

I hope this helps

Cor


亲爱的Cor,

谢谢你heko。但我并没有按照你的想法行事。我不知道怎么可以

我用这种方法:

EndCurrentEdit();


再次感谢Cor,

Jan


" Cor Ligthert"写道:
Dear Cor,
thank you for you heko. But I didn''t follow your think. I don''t know How can
I use this method:
EndCurrentEdit();

Thank you again Cor,
Jan

"Cor Ligthert" wrote:
Jan,

与ADONET有关的最常见问题之一。

数据网格中的数据被推送在行更改后直到数据源。
你可以强制使用(这里显示第一个表)

BindingContext(ds.Tables [0])。EndCurrentEdit();

我希望这有帮助

Cor
Jan,

One of the most asked questions in relation to ADONET.

The data in the datagrid is pushed down to the datasource after a rowchange.
You can force that with (here showed for the first table)

BindingContext(ds.Tables[0]).EndCurrentEdit();

I hope this helps

Cor



亲爱的朋友

使用BindingContext(ds.Tables [0])。EndCurrentEdit();


谢谢,

Siju


-

通过 http://www.dotnetmonster.com <发布的消息/ a>
Dear friend
use BindingContext(ds.Tables[0]).EndCurrentEdit();

thanks,
Siju

--
Message posted via http://www.dotnetmonster.com


这篇关于从DataGrid添加新行到数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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