C# – DatagridView Not Displaying the error icon or error text

cdatagridviewwinforms

I have a win form (c#) with a datagridview. I set the grid's datasource to a datatable.

The user wants to check if some data in the datatable exists in another source, so we loop through the table comparing rows to the other source and set the rowerror on the datatable to a short message. The datagridview is not showing these errors. The errortext on the datagridviewrows are set, but no error displayed.

Am I just expecting too much for the errors to show and they only show in the context of editing the data in the grid?

I have been tinkering with this for a day and searched for someone that has posted a simalar issue to no avail – help!

Best Answer

Check that AutoSizeRowsMode is set to DataGridViewAutoSizeRowsMode.None. I have found that the row Errortext preview icon is not displayed when AutoSizeRowsMode is not set to the default of none.

DataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None
Related Topic