绑定gridview与arraylist asp.net/c# [英] Binding gridview with arraylist asp.net/c#

查看:159
本文介绍了绑定gridview与arraylist asp.net/c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个网格视图,我可以将该网格视图列与数组列表绑定在一起吗?

I have created a grid view, can I bind that grid view columns with a array list ?

如果可以的话,请您写一个示例代码。

If it is possible can you please write a sample code.

感谢您的期待

推荐答案

是的,这是可能的。您必须在网格视图中指定列,并将它们绑定到某个表达式,具体取决于您需要和ArrayList的内容(您在其中输入什么类型的对象?),然后在后面输入代码:

Yes,it is possible. You have to specify columns in you grid view, bind them to some expression, depending on your needs and contents of the ArrayList (what kind of objects do you sotre in it?) and then just type in your code behind:

myGrid.DataSource = myArrayList;
myGrid.Databind();

这篇关于绑定gridview与arraylist asp.net/c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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