This is my first post...I hope I am following by all protocols...
I have a datagrid with the first cell containing a "Delete" linkbutton (eg: a ButtonColumn as defined in datagrid's PropertyBuilder).
As I build the data into the grid, I test the current datagrid record to determine if it is already marked as "deleted" ('ExpirationDate' column value less than today's date) such that a deleted record should not have the "Delete" linkbutton 'active' (eg: clickable). In all other cases, the "Delete" linkbutton should be 'active'.
I have tried several of the following statements inside a method executed by the datagrid's "OnItemDataBound" event but find that the links still remain 'active' even though they appear in the typical disabled grey coloring:
--------code snippet start--------
string expdate= ((DataRowView)e.Item.DataItem).Row.ItemArray.ToString();
DateTime dt = Convert.ToDateTime(expdate)
if (dt <= DateTime.Today)
//next line disables link in cell....but you can still click link
e.Item.Cells.Enabled = false;
//next line disables entire row...but you can still click link
e.Item.Enabled = false;
//next line hides link but actually removes 1st cell entirely....giving ugly left shift of current record
e.Item.Controls.Visible = false;
--------code snippet end--------
Many thanks in advance!