This is a migrated thread and some comments may be shown as answers.

Exclamation image overlaps on row validation

1 Answer 85 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 04 May 2011, 09:44 PM
When a row in my grid isn't valid, this little exclamation point shows up in the far left hand column. The problem is it overlaps whatever image is already there (like the pencil when editing a row)  which makes it hard to tell what it's supposed to be. Is there a way to fix this?

1 Answer, 1 is accepted

Sort by
0
Svett
Telerik team
answered on 09 May 2011, 04:25 PM
Hi Jason,

You can remove the arrow image of the current row, when it has a data error. You should do that in the ViewCellFormatting event:

this.radGridView1.ViewCellFormatting += new CellFormattingEventHandler(radGridView1_ViewCellFormatting);

private void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
    GridRowHeaderCellElement rowHeaderCell = e.CellElement as GridRowHeaderCellElement;
 
    if (rowHeaderCell == null)
    {
        return;
    }
 
    GridDataRowElement dataRow = rowHeaderCell.RowElement as GridDataRowElement;
 
    if (dataRow != null)
    {
        if (dataRow.ContainsErrors && dataRow.IsCurrent)
        {
            rowHeaderCell.Image = null;
        }
        else
        {
            rowHeaderCell.ResetValue(LightVisualElement.ImageProperty, Telerik.WinControls.ValueResetFlags.Local);
        }
    }
}

I hope this helps.

Greetings,
Svett
the Telerik team
Q1’11 SP1 of RadControls for WinForms is available for download; also available is the Q2'11 Roadmap for Telerik Windows Forms controls.
Tags
GridView
Asked by
Jason
Top achievements
Rank 1
Answers by
Svett
Telerik team
Share this question
or