Disabling the EditCommandColumn of datagrid

ninel

Active member
Joined
Mar 23, 2005
Messages
32
Location
Land O Lakes, Florida
Programming Experience
3-5
I am using a datagrid with the "EditCommandColumn". This creates an "EDIT" link as one of the columns of the grid.

My question is...Can I disable the link based on another column of the grid?

Ex: I have 2 records in the grid. 1st record has state of NY. 2nd record has state of NJ. If the state is NY I don't want the "edit" link of the EditCommandColumn visible. In other words, I don't want the user being able to edit the NY record.

Is this possible?

Thanks,
Ninel
 
You could try this in the item created event....


VB.NET:
 If e.item.ItemType = ListItem.AlternatingItem then
      CType(e.item.FindControl("btnEdit"), Button).Enabled = False
   end if
 
//Assuming the item has an ID
 
Back
Top