Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using that code to Deactivate or delete the lines in one click from GridView.
C#
private void btnDeactivate_Click(object sender, EventArgs e)
{
    if (btnDeactivate.Text == "Deactivate")
    {
        tbCardName.Enabled = false;
        tbCardDescrptn.Enabled = false;
        btnDeactivate.Text = "Activate";


        objCardType.CardName=tbCardName.Text;
        objCardType.CardDescription=tbCardDescrptn.Text;
         int t =objCardType.DeleteUpdate();
         if (t > 0)
         {
             lblOutPut.Text = "Deleted";

         }
    }



[Edit member="Tadit"]
Added pre tags.
[/Edit]
Posted
v2
Comments
Not clear.
abhishek_singh 16-Apr-14 9:57am    
please clarify your question, what is the location of btnDeactivate
Ganesh KP 17-Apr-14 0:06am    
Please give some more clarity regarding your question. I assume that you want to delete a selected record or row from a grid view on a button btnDeactivate click. Am I right?

And also what your code is doing, I am not very sure about it, please add a necessary comments like what error you got it and what needs to be done.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900