| |

VerySource

 Forgot password?
 Register
Search
View: 674|Reply: 5

Urgent !!! gridview problem

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-1 13:30:01
| Show all posts |Read mode
I use template columns in gridview, and one of them uses textbox to enter the number, to determine whether to enter a value. If the value is entered, the row is saved to the database. What should I write?
Reply

Use magic Report

0

Threads

64

Posts

45.00

Credits

Newbie

Rank: 1

Credits
45.00

 China

Post time: 2020-5-11 10:30:01
| Show all posts
Use a verification control in the foreground or Findcontrol in the background to find the Textbox and see if it is empty
Reply

Use magic Report

0

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-5-11 23:45:01
| Show all posts
The first child of the table is text
The second one is the control you added
Reply

Use magic Report

0

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-5-12 09:30:01
| Show all posts
for (...)
{
TextBox tb = (TextBox) GridView.Rows [i] .Cells [0] .FindControl ("");
     if (tb.Text! = "")
     {
     sql ...
     }
}
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-5-16 11:45:01
| Show all posts
just: I wrote it like this, but I always report "the object reference is not set to the instance of the object"
do not know why
Reply

Use magic Report

0

Threads

8

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-5-25 18:30:01
| Show all posts
Take a look at the code
Can't tell clearly
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