We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to selectively disable linkbuttons in datagrid cell

Thread ID:

Created:

Updated:

Platform:

Replies:

3426 Mar 18,2003 12:16 PM UTC Mar 22,2003 11:05 PM UTC WinForms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 18, 2003 12:16 PM UTC

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[4].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[0].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[0].Visible = false; } --------code snippet end-------- Many thanks in advance!

Administrator [Syncfusion]
Replied On March 22, 2003 11:05 PM UTC

This forum is for questions regarding Essential Grid, not the Windows Forms DataGrid. Try posting in the Windows Forms FAQ forum or on Microsoft newsgroups. Stefan

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;