1.method:

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 (DetaGrid_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 = "在选择另一条目前,请先保存或取消对当前条目的修改!";
                    isEditing = true;
                }

            }

        }



2.method:

  
protected void DataGrid_OrderInfo_ItemCommand(object source, DataGridCommandEventArgs e)
        
{
           
if (e.CommandName == "Memo")
            
{
                
//获取控件中的选定项的索引
                this.DataGrid_OrderInfo.SelectedIndex = e.Item.ItemIndex;

                
if(DataGrid_OrderInfo.SelectedIndex == -1)
                
{
                    
this.OrdersDetail.Visible = true;
                    Memo 
= this.txtMemo.Text.Trim();
                    IsDel 
= this.chkIsDel.Checked.ToString();
                    Datetimed 
= Convert.ToDateTime(this.txtDateTimed.Text.Trim());
                    CustomerId 
= Convert.ToInt32(this.txtCustomerId.Text.Trim());
                    ShipDate 
= Convert.ToDateTime(this.txtshipDated.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());
                    
//展示购物车中的商品
                    BindDatagrid_ShoppingCart(CartId, ProductId);


                   

                }

                
else
                
{
                    Response.Write(
"<script language=javascript>alert('请注册为正式会员才行')</script>");

                }

            }



        }


如果没有在代码中没有DataGrid_CannelCommand() and DataGrid_UpdateCommand() 时就采用第二种方法。

 
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值