Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi,
in my project i have one gridview columns(Name,Address,Country,Status and one link button )if i click that link button the status should be changed like(active(or)inactive)
while the link button is clicked at the time the status is active means then it should be changed to inactive like that wiseversa inactive to active.how to do this plz help me.if posible plz tell step by step im in begginer level
Posted
Updated 12-Sep-18 23:52pm
Comments
ManavGuru 10-May-12 4:34am    
you can use update command for active and deactive status.
dineshdena 10-May-12 6:56am    
will u plz explain me i tried like this but it showing error

protected void change(object sender, GridViewSelectEventArgs e)
{
if (GridView1.Rows[e.NewSelectedIndex].Cells[3].Text == "Active")
{
TextBox txtAddress1 = (TextBox)GridView1.Rows[e.NewSelectedIndex].Cells[3].Text("Inactive");
}
}

1 solution

Why not have the link button post back to the same page but with some query string. On the page load check if the query string is present then toggle the active status. if it is not present simply present the data as is.
 
Share this answer
 

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