A slightly strange DataGrid: click "edit" to jump to the datagrid1_updatecommand

Source: Internet
Author: User
Today, when I wrote aspx, I found that the DataGrid had a slightly strange place: I associated editcommand with the DataGrid. on the page, when "edit" is clicked for the first time, there is no response. When "edit" is clicked for the second time, a text box is displayed.

Debugging found: The first time I clicked "edit ",ProgramWhen the datagrid1_editcommand is entered, an exception occurs. The second time "edit" is clicked, It is jumped to the datagrid1_updatecommand and executed. of course, I have to solve the exceptions in the program, but I am a little worried about the DataGrid when I click "edit" as "Update. in the datagrid1_updatecommand

Try {} Catch {Datagrid1.edititemindex= -1;}

It seems that the problem no longer occurs. Who has similar experience? Thank you for your attention.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.