| |

VerySource

 Forgot password?
 Register
Search
View: 629|Reply: 3

Two checkboxes respond to each other

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-3-1 22:00:01
| Show all posts |Read mode
The first and last columns in the grid are checkbox columns;

Assume that the checkbox of the first column is replaced by A, and the checkbox of the last column is replaced by B;


Claim:

1. When B is selected, A is selected automatically;
2. In the state where A and B are selected at the same time, when A's selected state is cancelled, B must also be automatically unselected.

Please prawn, please.
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 Invalid IP Address

Post time: 2020-5-14 18:00:01
| Show all posts
Use ItemCommand event to judge
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-5-16 15:00:01
| Show all posts
Can the prawn upstairs elaborate? Thank you
Reply

Use magic Report

0

Threads

58

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-5-18 07:15:02
| Show all posts
itemCreate:

CheckBox A = e.item.FondControl ("Aid") as CheckBox
CheckBox B = e.item.FondControl ("Bid") as CheckBox

if (A! = null&&B! = null) {
    string js1 = string.Format ("if (document.getElementById ('{0}'). checked) document.getElementById ('{1}'). checked = true;", B.ClientID, A.ClientID);
    B.Attributes ["onclick"] = js1;
   
    string js2 = string.Format ("if (document.getElementById ('{0}'). checked) document.getElementById ('{1}'). checked = false;", A.ClientID, B.ClientID);
    A.Attributes ["onclick"] = js2;

}
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