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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Handle errorstates in DataTable

Thread ID:





6493 Aug 14,2003 08:23 AM UTC Aug 14,2003 01:38 PM UTC WinForms 1
Tags: GridControl
Markus Kraft
Asked On August 14, 2003 08:23 AM UTC

Hi, my validationfactory provides me a defined table with rows- and columnsproperty "hasErrors". if(ValidationDataDataSet.Tables[0].HasErrors == true) { errorRowArray = ValidationDataDataSet.Tables[0].GetErrors(); errorColumnArray = errorRowArray[0].GetColumnsInError(); } Is it possible to highlight the cells with errorstate == true (automatically)in griddataboundgrid ? Because it's absolutly complicated to manage errorcells and mark them in the GDBG. greetings markus

Administrator [Syncfusion]
Replied On August 14, 2003 01:38 PM UTC

You will have to handle an event, and in your handler, given a row and column, determine whether that row and column are in error or not. A couple of events you could use for this include PrepareViewStyleInfo or Model.QueryCellInfo.
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
	if(e.ColIndex > 0 && e.RowIndex > 0)
		if( e_RowIndex_and_e_ColIndex_in_error )
			e.Style.BackColor = Color.Red;
You may have to do some extra work as your error provider does not expose a method that returns whether a particular row and column is in error, and this is teh information you need to use these events.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon