数据网格视图问题 [英] Problem with data grid view

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

问题描述

大家好,
我在处理数据gridview时遇到了一些问题.我试图在绑定到数据表的数据girdview中添加一行.负责添加行的代码是

Hi EveryBody,
I am having a little problem with the data gridview handling. I am trying to add a row in data girdview that is bounded to a data table. the code that is responsible to add rows is,

string []rows=new string[2];
               rows[0] = rw.CardserialNo;
               rows[1]= tbname.Text;
               this.enteranceLogDataSet.Denied_List.Rows.Add(rows);


有问题.有时,它会在网格中添加两行的经验单元之一.您能指导我如何避免在datagird视图中出现不需要的行吗?
谢谢
Hug


having a problem. sometimes it add two rows one of empity cells in the grid. Can you please guide me how can I avoid undesired rows in the datagird view.
Thank you
Hug

推荐答案

好吧,逻辑上的事情是在添加数据之前检查您的数据是否为空.
Well, the logical thing to do would be to check that your data is not empty before adding it.


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

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