将数据从文本框传递到gridview如何 [英] pass data from to textboxes to gridview how to

查看:99
本文介绍了将数据从文本框传递到gridview如何的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

http://i.stack.imgur.com/vnvHt.png [ ^ ]



i想要在按下按钮到gridview时从Nametextbox和commenttexbox传递数据。我该怎么解决这个问题?我也在列表中有这个列我可以存储它,所以我想将它存储在gridview中,并且在列表中我还有colums。

解决方案

我认为你需要做的事情,就是保存文本框名称和注释中的值,然后用它来查看datagridview中在datagridview中插入值的表格是namedatagrid [indexcolumn,indexrow] .value = valueyouwanttoshow



例如:





dataGridView [0 ,0] .value =Hello World;













问候!


使用数据表或列表存储您的值,然后将值分配给gridview的数据源。

http://i.stack.imgur.com/vnvHt.png[^]

i want to pass data from Nametextbox and commenttexbox when pressing the button to an gridview. how should i solve this? i also has this column in a list there i can store it, so i want to store it in the gridview and also in the list were i have the colums.

解决方案

Hi,I think the firts you need to do, it''s to save the values in the textbox name and comment, then use it to see in the datagridview the form to insert values in the datagridview is namedatagrid[indexcolumn,indexrow].value = valueyouwanttoshow

for example:


dataGridView[0,0].value = "Hello World";






regards!


use datatable or list to store your values, then assign the values to the datasource of your gridview.


这篇关于将数据从文本框传递到gridview如何的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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