无法将列表绑定到gridview [英] Unable to bind list to gridview

查看:79
本文介绍了无法将列表绑定到gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用WCF将列表绑定到gridview,当我使用断点检查时,我得到了值但是我看不到gridview了吗?



I am binding a list to gridview using WCF,when i check using breakpoint i am getting the values but i am unbale to see the gridview?

public List<Customer> Getall()
       {
           return cutomerList;
       }

       public static List<Customer> cutomerList = new List<Customer>()
        {
       new Customer {CustomerID = 1, CustomerName="Sujeet",
       Address="Pune", EmailId="test@yahoo.com" },
       new Customer {CustomerID = 2, CustomerName="Rahul",
       Address="Pune", EmailId="test@yahoo.com" },
       new Customer {CustomerID = 3, CustomerName="Mayur",
       Address="Pune", EmailId="test@yahoo.com"}
        };







protected void Page_Load(object sender, EventArgs e)
       {
           if (!IsPostBack)
           {
               proxy = new WCFExample.Service1();
               GridView1.DataSource = proxy.Getall();
               GridView1.DataBind();
           }
       }

推荐答案



我希望如果你通过以下链接,你会找到更好的解决方案,



http://forums.asp.net/t/1109165.aspx/1 [ ^ ]


我已经检查了它,但它工作正常。
I already checked it,but it dint work.


参见..

http:// www.aspdotnet-suresh.com/2011/07/how-to-bind-generic-list-to-gridview.html [ ^ ]


这篇关于无法将列表绑定到gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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