There is a checkbox in the gridview, I want to click the select all button outside the gridview, a

Updated on technology 2024-02-09
14 answers
  1. Anonymous users2024-02-05

    Select all. protected void checkbox2_checkedchanged(object sender, eventargs e)

    for (int i = 0; i <= - 1; i++)

    checkbox cbox = (checkbox)"checkbox1");

    if ( == true)

    true;false;

    Delete. protected void button2_click(object sender, eventargs e)

    sqlcon = new sqlconnection(strcon);

    sqlcommand sqlcom;

    for (int i = 0; i <= - 1; i++)

    checkbox cbox = (checkbox)"checkbox1");

    if ( == true)

    string sqlstr = "delete from Flying Fox Studios where ID number='" + "'";

    sqlcom = new sqlcommand(sqlstr, sqlcon);

    ;bind();

  2. Anonymous users2024-02-04

    Here's a way to write all to see if it works for you?

    protected void checkall_checkedchanged(object sender, eventargs e)

    checkbox chk = (checkbox)sender;

    if (for (int i = 0; i < i++)checkbox)"chk1")).checked = true;

    elsefor (int i = 0; i < i++)checkbox)"chk1")).checked = false;

  3. Anonymous users2024-02-03

    You put a checkbox at the header of the checkbox column in the gridview, and ticking it means that all are selected (1. The checkbox below is also automatically checked. 2. If any of the following checkboxes are deselected, the top one will also be automatically canceled) and used as a marker for later use.

    If you have a paged part, you will definitely not be able to go to the value through the gridview, and you can go to the data source and rescratch it according to the mark just now.

  4. Anonymous users2024-02-02

    It's simple. One cycle to get it. grdposition is the id of the gridview, cboxselectall is cheakbox for headerrow, cheakbox for cboxselect...

    Specifically** is given to you. It's up to you whether you can understand it or not.

    if ((checkbox)"cboxselectall")).checked == true)

    else}}

  5. Anonymous users2024-02-01

    page: Added to the gridview.

    Background cs:protected void checkbox2 checkedchanged(object sender, eventargs e)}

  6. Anonymous users2024-01-31

    The ground floor is correct.

    It would be very convenient if you used the jquery selector.

    #gridview1 :checkbox").attr("checked","checked");

    As long as this sentence realizes all the ** upstairs.

  7. Anonymous users2024-01-30

    This can be easily implemented by writing a js!

    If you're using server-side events, you'll also need to use aotopostback(); also use databind(); Save status information as well! It's too unreasonable and too complicated! What can be achieved on the client side is better than on the server side!

    This is the **:

    Select all this is js**:

  8. Anonymous users2024-01-29

    Using JS or jQuery can solve the problem better and faster.

    If you have to use the backend**.

    FindControl is required.

  9. Anonymous users2024-01-28

    ;Put it outside of the for loop, otherwise it will be rebound after being executed once.

  10. Anonymous users2024-01-27

    Use the JS in the foreground to implement all selection.

    function cbselectall(gridviewid, curcb) }

    curcb is the ID of the checkbox that is selected all

  11. Anonymous users2024-01-26

    Of course, you can't choose, you take a closer look.

    if ( == true) This is the selected state, but will there be any changes to the condition if he continues to select?

    else here is not selected, but in the conditions, he has to continue to be unselected, will there be changes?

    It's a good thing to change ......

    if ( == true)

    else

  12. Anonymous users2024-01-25

    checkbox cbox = (checkbox)("checkbox1"));

    rows[0].cells[checkbox's column index -1].findcontrol("checkbox1")

    And if (that's it, don't need to ==true so much trouble else.)

    In addition, the effect is much better if it is implemented with JS, it will not refresh the page and will not return the callback, and it is not recommended to use the background to write this all-select function.

    function selectall(obj) }

  13. Anonymous users2024-01-24

    autopostback="true"You don't have to add this attribute.

  14. Anonymous users2024-01-23

    checkbox1 can't use this, you can't get "checkbox1" in the page after running, you can get its name by looking at the source code in the page after running.

    Otherwise, your ID wouldn't change.

Related questions
4 answers2024-02-09

How many words? Are there any specific essay requirements?

28 answers2024-02-09

I don't know if the landlord wants to ask about the play or real life. >>>More

9 answers2024-02-09

Landlord, I don't know what your computer level is, I can give you how to delete it, but I have to warn you first. >>>More

14 answers2024-02-09

The solar system consists of eight planets and their moons and more than 6,000 asteroid belts.

10 answers2024-02-09

The first question: I will ask this question to show that you have not seen the soldier assault**,**There is a detailed explanation in it, leaving Mu Mu because Commander Wang values Mu Mu and is reluctant to give it away, leaving him to lay eggs and hold the nest. >>>More