按钮单击时可编辑的gridview [英] editable gridview on button click

查看:67
本文介绍了按钮单击时可编辑的gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有这个问题让我很困惑......我有一个带编辑,更新和取消属性的​​可编辑网格视图。现在当我在pageload中调用gridview函数时,如下所示,它工作正常..



hi all,

I have this question that is really confusing me......I have got one editable gridview with edit, update and cancel properties. Now when I am calling the gridview function in pageload like following, it works fine..

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindcon();  //gridview
        }
    }





但我需要的是在按钮点击时以可编辑模式显示gridview ...所以我在点击事件内调用函数.....但随后编辑或者更新或取消不能正常工作....任何人都可以解释原因吗?





but what I need is to show the gridview in editable mode on button click...so I am calling the function inside click event.....but then the edit or update or cancel are not working properly....can anyone explain why??

protected void btn_Click(object sender, EventArgs e)
    {
        lblnmorg.Text = "ABC";
        orgnm = "ABC";
        bindcon();   //gridview
    }





这不工作......



this isnt working...

推荐答案

你好
你不能绑定两次。

请在按钮点击事件中删除bindcon()。

Yours Farhad。
Hi You can not bind twice.
Please delete bindcon() on button click event.
Yours Farhad.


没有任何内容只是在readonly false grid的属性中处于可编辑模式



如果你想只读一些字段那么你也可以做





轻松的任务
nothing just go in the property of readonly false gridview is in editable mode

and if you want to make some field readonly then also you can do


its easy task


这篇关于按钮单击时可编辑的gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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