This is my .aspx page ::
onclick="btnCreate_Click" />
AutoPostBack="true" DataKeyNames="RequestId,RequestCompanyName,StepID"
CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt">
This is my .aspx.cs page ::
public partial class Home : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
BindData();
}
}
private void BindData()
{
gvRequests.DataSource = BusinessUtility.SelectCurrentRequestsForUser(Master.PageController.UserData.CompanyId);
gvRequests.DataBind();
}
public string GetStatus(int stepId)
{
if (stepId == 3)
return "Saved - Mapping to be verified";
if (stepId == 4)
return "Mapping Verified";
if (stepId == 5)
return "Directors Info Entered";
if (stepId == 10)
return "Completed";
else
return "Unknown";
}
}
}
I just need to check that if my bound field' status id is incomplete then user can not able to press Create New Button, otherwise User can.
Pls help as soon as pos.
Thanks in advance.


Om prakash Singh126 reputationPosted Jul 15, 2011, 8:37 PM EDT
and in this loop check the status and set the button enable property true or false.
foreach(datagriditem di in gridview.rows)
{
if (di.cell[2].text!="Completed"){
flag=false;
break;
}
}
if(flag!=false) btnCreate.enable=true; else btnCreate.enable =false;
Otherwise, You can set the button enable proberty here
if (stepId == 10){
btncreate.enable=true
return "Completed";
}
Try this and revert