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

[Solved] Datatable errors

2 Answers 153 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mihai Velicu
Top achievements
Rank 1
Mihai Velicu asked on 23 Mar 2010, 07:13 PM
Hi !

If I validate data at datatable level and I have errors set at the row level or at the column level how I can see them in radgridview?
With microsoft data grid they are automatically showed.

Regards,
Mihai

2 Answers, 1 is accepted

Sort by
0
Accepted
Jack
Telerik team
answered on 24 Mar 2010, 03:18 PM
Hello Mihai Velicu,

Currently RadGridView doesn't show an error indicator automatically when the data source indicates an error. We plan to add this feature in one of our upcoming releases. However, you can use the CellFormatting event to change the cell style when there is an error in the data source:

void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
    DataRowView rowView = e.CellElement.RowInfo.DataBoundItem as DataRowView;
    if (rowView != null && rowView.Row.HasErrors)
    {
        e.CellElement.BackColor = Color.Red;
        e.CellElement.DrawFill = true;
        e.CellElement.ToolTipText = rowView.Row.RowError;
    }
    else
    {
        e.CellElement.ResetValue(LightVisualElement.BackColorProperty);
        e.CellElement.ResetValue(LightVisualElement.DrawFillProperty);
        e.CellElement.ToolTipText = string.Empty;
    }
}

I hope this helps.

 

Best wishes,
Jack
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Mihai Velicu
Top achievements
Rank 1
answered on 24 Mar 2010, 03:50 PM
Awesome, thank you very much !

Regards,
Mihai Velicu
Tags
GridView
Asked by
Mihai Velicu
Top achievements
Rank 1
Answers by
Jack
Telerik team
Mihai Velicu
Top achievements
Rank 1
Share this question
or