Q: repositoryitemhyperlinkedit show/hide according to the row data I am using an XtraGridView control in my winform. Now I added a RepositoryItemHyperLinkEdit to it. But I want to show/hide each link according to the row data.
How can I achieve this?
Thanks for any help..
I tried the next code but it did not work, the cell did not be empty.
("Show link" part is ok, but String.Empty does not work)
private void xgvGrid_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
        {
            if (e.Column == gcControlField)
            {
                if (xgvGrid.GetFocusedRowCellValue("ControlField") != null)
                {
                    if (xgvGrid.GetFocusedRowCellValue("ControlField").ToString() == "LINK")
                        e.DisplayText = "Show link";
                    else
                        e.DisplayText = string.Empty;
                }
            }
        } 


A: You can add your checking in the event GridView.CustomColumnDisplayText.
e.g. Each row is bind to a Person instance
private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
{
    // gcLink is your column using repositoryitemhyperlinkedit
    if (e.Column == gcLink)
    {
        var person = gridView1.GetRow(e.RowHandle) as Person;
        if (person != null)
        {
            // Logic to show/hide the link based on other field
            if (person.FirstName == "John")
                e.DisplayText = string.Empty;
            else
                e.DisplayText = person.Link;
        }
    }
}

