| |

VerySource

 Forgot password?
 Register
Search
View: 585|Reply: 2

Bind HashTable to GridView. Something went wrong! Please take a look

[Copy link]

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-2-2 14:00:02
| Show all posts |Read mode
Hashtable ht1 = new Hashtable ();
        ht1.Add ("1", "11");
        ht1.Add ("2", "22");


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

How to bond
Reply

Use magic Report

0

Threads

322

Posts

115.00

Credits

Newbie

Rank: 1

Credits
115.00

 China

Post time: 2020-3-20 21:45:01
| Show all posts
<asp: GridView AutoGenerateColumns = "false"
Then in
<COLUMN>
<asp: BoundField DataField = "Key" HeaderText = "Key" />
<asp: BoundField DataField = "Value" HeaderText = "Value" />
Reply

Use magic Report

1

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-3-21 21:30:02
| Show all posts
Many thanks!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list