1. Method:

Source: Internet
Author: User
1. method:
Public void DetaGrid_bookcate_ItemCommand (object sender, DataGridCommandEventArgs e)
...{

// This event fires prior to all of the other commands
// Use it to provide a more graceful transition out of edit mode

DetailCheckIsEditing (e. CommandName );
}

Public void DetailCheckIsEditing (string commandName)
...{

If (detated_bookcate.edititemindex! =-1)
...{

// We are currently editing a row
If (commandname! = "Cancel" & commandname! = "Update ")
...{

// User's edit changes (if any) will not be committed
// Message. InnerHtml = "when selecting another current entry, save or cancel the modification to the current entry first! ";
IsEditing = true;
}
}
}


2. method:

Protected void datagrid_orderinfo_itemcommand (Object source, datagridcommandeventargs E)
...{
If (E. commandname = "memo ")
...{
// Obtain the index of the selected item in the control
This. Maid = E. Item. itemindex;

If (datagrid_orderinfo.selectedindex =-1)
...{
This. OrdersDetail. Visible = true;
Memo = this.txt Memo. Text. Trim ();
IsDel = this. chkIsDel. Checked. ToString ();
Datetimed = Convert.ToDateTime(this.txt DateTimed. Text. Trim ());
Customerid = convert.toint32(this.txt customerid. Text. Trim ());
Shipdate = convert.todatetime(this.txt shipdated. Text. Trim ());
Hasview = This. chkhasview. Checked. tostring ();
Hascheck = This. chkhascheck. Checked. tostring ();
Hassend = This. chkhassend. Checked. tostring ();
Hasreceive = This. chkhasreceive. Checked. tostring ();
Adminpub. spdatagrid_orderinfo_itemcommand (memo, isdel, datetimed, customerid, shipdate, hasview, hascheck, hassend, hasreceive );
Int cartid = convert. toint32 (request. Params ["cartid"]. tostring ());
Int productid = convert. toint32 (request. Params ["productid"]. tostring ());
// Display items in the shopping cart
BindDatagrid_ShoppingCart (CartId, ProductId );




}
Else
...{
Response. Write ("<script language = javascript> alert ('register as a formal member ') </script> ");

}
}


}

If the Code does not contain DataGrid_CannelCommand () and DataGrid_UpdateCommand (), the second method is used.

 

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.