分配和绑定数据问题 [英] Assigment and bind data problem

查看:75
本文介绍了分配和绑定数据问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我有一个问题。让我们解释一下:

我创建了一个DataTable'DataT'变量并向该变量添加了行.SameTime我有datagridview.After我将'DataT'分配到DataGridView的DataSource属性。

我得到'DataT'Rows.Count属性。它的值为10.但当我移除5行DataGridView时,此值从10减少到5。

那么为什么减少我的值我只删除DataGridView的行但是我没有删除'DataT'的行,尽管'DataT'的行数从10减少到5.

我还没有解决这个问题。



我等你的帮忙。

我谢谢你.....



我尝试了什么:



我研究和编码等mnay算法。但那些没有解决这个问题。

解决方案

当你使用 DataSource 时,数据绑定到 DataGridView

这是一篇很棒的文章解释数据绑定:

详细的数据绑定教程 [ ^ ]

Hi guys.I have a problem.Let's explain this:
I create a DataTable 'DataT' variable and added row to this variable.SameTime i have datagridview.After i assingmented 'DataT' to DataSource property of DataGridView.
I get 'DataT' Rows.Count property.It's value 10.But this value decrease from 10 to 5 when i removed 5 Rows of DataGridView.
So why decrease my value i just remove Rows of DataGridView but i did not remove rows of 'DataT' although rows count of 'DataT' decrease from 10 to 5.
I have not solve this problem.

I have wait to your help.
I thank you.....

What I have tried:

I research and coding and so mnay algorithm.But those don't solve that problem.

解决方案

When you use DataSource, the data is bound to the DataGridView.
Here is an excellent article explaining data binding:
A Detailed Data Binding Tutorial[^]


这篇关于分配和绑定数据问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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