I want to disable the edit command for rows that have a specific value in say the third column. The code below seems to disable the whole edit column if the "if statement" is met jsut once.
Thanks
Doug
Thanks
Doug
protected void teamGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = e.Item as GridDataItem;
string firstName = dataItem["Firstname"].Text;
string lastName = dataItem["Lastname"].Text;
LinkButton button = dataItem["DeleteColumn"].Controls[0] as LinkButton;
button.Attributes["onclick"] = "return confirm('Are you sure you want to deactivate " + firstName + " " + lastName + "?')";
if (dataItem["EndDate"].Text != "")
{
LinkButton linkButton = (LinkButton)dataItem["EditCommandColumn"].Controls[0];
linkButton.Enabled = false;
dataItem["EndDate"].Font.Strikeout = true;
}
}
}