读书人

将HashTable邦定到GridView上.出了有关

发布时间: 2012-01-21 21:31:43 作者: rapoo

将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 " />

读书人网 >asp.net

热点推荐