如何在gridview中使用命令... [英] How to use command in gridview...

查看:66
本文介绍了如何在gridview中使用命令...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gridview中创建了数据库。我想显示行按钮然后我单击按钮然后行值更改。由deafault值假设是假的然后我点击按钮

值是改变true..how。????这个值只改变了管理员.. !!!



这个怎么做。????????



plz help。!!!!!



我尝试过:



i在gridview中创建了数据库。我必须显示按钮,但我点击按钮然后值没有改变......

i have creted database in gridview . i want to show that the row button then i click button then row value change. supose by deafault value is false then i click button
the value is change true..how.???? this value change only admin..!!!

so how do this.????????

plz help.!!!!!

What I have tried:

i have creted database in gridview . i have to show button but i click button then value was not change......

推荐答案

我不确定我是否遵循但如果你是试图处理GridView中的Button以更新值,然后你就可以这样做:



I'm not exactly sure if I follow but if you are trying to handle a Button that's inside your GridView to update a value then you could do it like this:

protected void Button1_Click(object sender, EventArgs e)
{
        Button b = (Button)sender;
        GridViewRow row = (GridViewRow)b.NamingContainer;
        if (row != null)
        {
            int index = row.RowIndex; //gets the row index selected
	    //your update code here
        }
}





如果我误解了,请详细说明,以便我能改进答案。



If i have misunderstood, please elaborate more so I can improve the answer.


这篇关于如何在gridview中使用命令...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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