如何在C#中将新行添加到datagridview的末尾 [英] How to add new rows to end of datagridview in c#

查看:297
本文介绍了如何在C#中将新行添加到datagridview的末尾的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据网格,其中包含Form1中数据库中的值.如果传递了来自form2的值,则这些值应添加在datagrid行的末尾.请帮助提供示例代码.....

i have a datagrid with values from database in Form1. If a pass a value from form2 then the values should add at the end of the datagrid rows. kindly help with sample code.....

推荐答案

看看: Depends4Net-第2部分 [
Have a look at: A Detailed Data Binding Tutorial[^]

I think you need to refactor your code - separating data and ui.

Have a look at what I do here:Depends4Net - Part 2[^] - this makes working with your data quite easy.

Best regards
Espen Harlinn


如何在DataGridView的任何位置添加新行? a> [ ^ ]
http://www.dotnetperls.com/datagridview-add-rows [
http://www.daniweb.com/software-development/csharp/threads/342037/add-row-to-end-of-datagridview-programatically[^]
How to add new Row anywhere on the DataGridView ?[^]
http://www.dotnetperls.com/datagridview-add-rows[^]


这篇关于如何在C#中将新行添加到datagridview的末尾的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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