| |

VerySource

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

Ask to get the value of a certain row of the gridview! !! !! !! !! !! !! !! !! !!

[Copy link]

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-2-1 10:20:01
| Show all posts |Read mode
Why the prompt GridViewRow row = GridView1.Rows [e.NewSelectedIndex] cannot be converted
What namespace or other needs to be imported?

protected void GridView1_SelectedIndexChanging (object sender, GridViewSelectEventArgs e)
 GridViewRow row = GridView1.Rows [e.NewSelectedIndex]
 if (row.RowState == DataControlRowState.Selected)
this.Label3.Text = row.Cells [1] .Text.ToString ();
           this.txt1.Text = "Hello"
end if
end sub
Reply

Use magic Report

0

Threads

5

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-13 10:00:01
| Show all posts
Try it like this:
GridViewRow row = (gridviewrow) GridView1.Rows [e.NewSelectedIndex]
Reply

Use magic Report

0

Threads

64

Posts

45.00

Credits

Newbie

Rank: 1

Credits
45.00

 China

Post time: 2020-3-13 11:30:01
| Show all posts
GridViewRow row = (GridViewRow) GridView1.Rows [e.NewSelectedIndex]
Reply

Use magic Report

0

Threads

43

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-3-13 14:00:01
| Show all posts
Dim kind2 As String = CType (GridView1.Rows (e.RowIndex) .FindControl ("kind21"), DropDownList) .SelectedValue
Dim qty As String = CType (GridView1.Rows (e.RowIndex) .FindControl ("qty1"), TextBox) .Text
Reply

Use magic Report

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-3-14 14:30:02
| Show all posts
GridViewRow row = (gridviewrow) GridView1.Rows [e.NewSelectedIndex]

The system prompts that gridviewrow is a type and cannot be used as an expression
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