Click here to Skip to main content
15,913,115 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Can anyone answer my question with c# coding:


In grid when i click update button it redirect into form and bind values on the form after updating the values i want to click update button the form having submit & update button..i want hide submit button when the page is redirect grid to form...

how can write coding for this...

please anyone can help me...
Posted
Updated 13-Nov-11 17:32pm
v2
Comments
Sergey Alexandrovich Kryukov 13-Nov-11 23:22pm    
It has nothing to do with ADO.NET. Instead, tag you UI library (ASP.NET? Forms? Tag it!).
--SA
Sergey Alexandrovich Kryukov 13-Nov-11 23:24pm    
What is "redirect grid to form"?
--SA

hi,
actually i can't understand ur question properly.
i am giving suggession upto what i understood.

//to disable the submit button use this but it will visible and u cannot able to access it
SubmitButton.Enabled = false;
//to hide the button from ur vission use this.
submitButton1.Visible = false;


hope it may help u..:)
 
Share this answer
 
v2
hi,
according to your code. you transfer to product page, when click on the update button.
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)

so you have a problem of finding the clicked id and need to disable the button.
for that you can use

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
// check the row type
if(e.Row.RowType == DataControlRowType.DataRow)
{
//Convert dataitem in to relavent object
Customer objCustomer =(Customer)e.row.dataitem;
//check with the query string id
if(objCustomer.id == int.parse( Session["ID"].tostring()))
e.Row.FindControl["btnUpdate"].Visible = false;
}


}

hope this will work.
 
Share this answer
 
v2

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