| |

VerySource

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

How to get the value of the current row and column of the gridview! !! !! !! !! !!

[Copy link]

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-2-6 16:00:01
| Show all posts |Read mode
How to get the value of the current row and column of the gridview! !! !! !! !! !!
Reply

Use magic Report

0

Threads

64

Posts

45.00

Credits

Newbie

Rank: 1

Credits
45.00

 China

Post time: 2020-3-26 08:30:02
| Show all posts
protected void GridView1_RowDataBound (object sender, GridViewRowEventArgs e)
    {
        e.Row.Cells [0] .Text;
    }

or

for (int i = 0; i <GridView1.Rows.Count; i ++)
        {
            GridView1.Rows [i] .Cells [0] .Text;
        }
Reply

Use magic Report

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-3-30 15:45:01
| Show all posts
It doesn't seem to work
Reply

Use magic Report

1

Threads

7

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 Unknown

Post time: 2020-4-4 18:45:01
| Show all posts
protected void GridView1_RowCommand (object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "View")
        {
        

            int rowIndex = Convert.ToInt32 (e.CommandArgument);


       }
}
Reply

Use magic Report

1

Threads

7

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-4-4 21:00:01
| Show all posts
View is the id of the binding button
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