| |

VerySource

 Forgot password?
 Register
Search
View: 627|Reply: 4

gridview small problem

[Copy link]

2

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-16 19:40:01
| Show all posts |Read mode
Which big brother can guide the younger, how to get the key value of the current row of GridView? (I have assigned values ​​to datakeynames.)
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-22 15:54:01
| Show all posts
Seems like e.Item.Index .....
Specifically I forgot, you can try this
The system will automatically generate
But you have to set the primary key DataKeyFiled when binding data
Reply

Use magic Report

0

Threads

25

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-1-23 01:36:01
| Show all posts
this.GridView1.DataKeys [e.Row.RowIndex] [0] .ToString ();
Reply

Use magic Report

2

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-1-24 17:00:01
| Show all posts
Response.Write (this.GridView1.DataKeys [e.Row.RowIndex] [0] .ToString ());
I tried it with this, but it appeared
"System.Web.UI.WebControls.GridViewEditEventArgs" does not contain the definition of "Row"
mistake.
Do you need to define something?
Reply

Use magic Report

2

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-2-13 16:00:01
| Show all posts
Which big brother can help solve this problem?
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