如何在asp.net中删除gridview中的行 [英] how to remove the rows in gridview in asp.net

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

问题描述

protected void dropdownlist1_SelectedIndexChanged(object sender, EventArgs e)
    {
        if (dropdownlist1.SelectedItem.ToString() == "Poor")
        {
            SetDropdowndetails("dropdownlist1", 1);
        }
        else
        {
             Selectednotpoor();
        }
    }

    private void SetDropdowndetails(string Dropdownname, Int32 Dropdownid)
    {
            SelectedDropdown = Dropdownname.ToString();
            hfnegativefeedback.Value = Dropdownid.ToString();
            Negativepnlpopup();
    }

    
    private void Negativepnlpopup()
    {
        try
        {
           
            textbox1.Text = "";
            DataTable dt = new DataTable();
            dt = (DataTable)ViewState["Remarks"];
            if (ViewState["Remarks"] != null)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    if (hfnegativefeedback.Value == dt.Rows[i][0].ToString())
                    {
                        textbox1.Text = dt.Rows[i][1].ToString();
                    }
                }
            }

            ModalPopupExtender1.TargetControlID = SelectedDropdown.ToString();
            textbox1.Focus();
            ModalPopupExtender1.Show();
            Pnlnegativefeedback.Visible = true;
        }
        catch (Exception e2)
        {
 
        }
    }







当我从下拉列表panelpopup中选择穷人时显示。

panelpopup如下。



NegativeFeedback



textbox1

ok(按钮)取消(按钮)



在textbox1中输入差的原因,然后单击确定按钮。然后选择下拉列表和textbox1原因,如gridview中所示。



如果假设用户想要点击优秀的drodpdownlist,那么糟糕的原因已经在gridview中删除了我该怎么办?使用csharp。





问候,

Narasiman P




when i select the poor from the dropdownlist panelpopup is displaying.
the panelpopup as follows.

NegativeFeedback

textbox1
ok(Button) cancel(Button)

in the textbox1 type the reason for poor and click the ok button. then selected dropdown and textbox1 reason as has been shown in gridview.

if suppose user want to click the Excellent in drodpdownlist, the poor reason has been removed in the gridview for that how can i do using csharp.


Regards,
Narasiman P

推荐答案

看到这个,

动态添加和删除ASP.NET GridView中的行 [ ^ ]

而不是 GridView.DelteRow [ ^ ]方法。



-KR
See this,
Dynamically adding and deleting rows from ASP.NET GridView[^]
Rather GridView.DelteRow[^] method.

-KR


可能会根据您的问题帮助您。



http://stackoverflow.com/questions/6377296/add- row-to-a-dynamic-datagridview [ ^ ]
may be help you according to your problem.

http://stackoverflow.com/questions/6377296/add-row-to-a-dynamic-datagridview[^]


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

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