如何创建数组列表使用DataGridView用户选择数据 [英] How can create a Array list Using DataGridView User select data

查看:89
本文介绍了如何创建数组列表使用DataGridView用户选择数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建数组列表使用DataGridView用户选择数据。这是我的gridview



How can create a Array list Using DataGridView User Select data.This is my gridview

private void gridVIEWData()
      {
          dt1.Columns.Add("InvoiceNO", typeof(string));
          dt1.Columns.Add("Invamount", typeof(decimal));
          dt1.Columns.Add("Lastpayment", typeof(decimal));
          dt1.Columns.Add("outstanding", typeof(decimal));
      

      }





我只需要在数组中获得用户选择的Invamount。



谢谢



I need get only User selected Invamount in Array.

Thank You

推荐答案

您应该使用数据源,而不是持有数据的控件。唯一真正的方法是遍历集合,从每一行中获取第1列,然后将它们推送到集合中。不是arraylist,他们不是强类型。通用列表。这是2014年。
You should work with the data source, not the control that is holding the data. The only real way, is to iterate over the collection, grab column 1 out of every row, and push them in to a collection. NOT an arraylist, they are not strongly typed. A generic list. This is 2014.


这篇关于如何创建数组列表使用DataGridView用户选择数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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