网格视图自动更新 [英] grid view automatic updation

查看:98
本文介绍了网格视图自动更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列贷款状态的网格视图。

默认贷款状态等待数据库。

我还有一个名称操作列。它是一个带编辑的命令字段(我将其重命名为''授权/拒绝'')。

当我点击''编辑''两个选项是''更新(我将其重命名为''授权'')''和''取消''(我将其重命名为''拒绝'')。

i当我点击更新时,即任何特定行的授权,然后该特定行的贷款状态显示为授权,当我点击取消即被拒绝时,贷款状态应显示为拒绝。

任何人请告诉我如何在cs文件上编码才能得到这个?

i have a grid view with a column loan status.
loan status by default is awaiting from data base.
i have a one more column with name action. it is a command field with edit (i rename it as ''Authorize/ rejected'').
when i click on ''edit'' two option is there ''update(i rename it as ''Authorize'')'' and ''cancel''(i rename it as ''rejected'').
i want when i click on update i.e Authorize of any particular row then loan status of that particular row appear as authorize and when i click on cancel i.e rejected the loan status should appear as rejected.
any one please tell me how i should code on cs file to get this?

推荐答案

//Write On Row Command Method
protected void GriView1OnRowCommand(object sender, GridviewRowEventargs )
{
 if(e.CommandName=="Edit")
 {
   int custid = Convert.toInt32(e.CommandArgument);
   hdnCustID.value = "" + custid;
 } 
}


//Update Button Click Coding
protected void btnUpdate_Click(object sender,EventArgs e)
{
 //Code to Update Loan Status 
  UpdateStatus(hdnCustID.value,"Approve");
} 

protected void btnCancel_Click(object sender,EventArgs e)
{
 //Code to Update Loan Status 
  UpdateStatus(hdnCustID.value,"Reject");
} 


这篇关于网格视图自动更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆