当前位置: 代码迷 >> ASP.NET >> 将HashTable邦定到GridView上.出了有关问题!请大家看看
  详细解决方案

将HashTable邦定到GridView上.出了有关问题!请大家看看

热度:9847   发布时间:2013-02-26 00:00:00.0
将HashTable邦定到GridView上.出了问题!请大家看看
Hashtable   ht1   =   new   Hashtable();
                ht1.Add( "1 ",   "11 ");
                ht1.Add( "2 ",   "22 ");


                this.GridView1.DataSource   =   ht1;
                this.GridView1.DataBind();

要如何邦定

------解决方案--------------------------------------------------------
<asp:GridView AutoGenerateColumns= "false " 然后在 <COLUMN> <asp:BoundField DataField= "Key " HeaderText= "Key " /> <asp:BoundField DataField= "Value " HeaderText= "Value " />