Hi,
I am using the Metro theme provided at this location. I cannot override the Error template of the XamDataGrid (grid as a whole and not of a row or cell). To make it clear here is the situation I use it for. I have a list of persons that is bound to the grid and I have a validation (using IDataErrorInfo) on the collection property that it is Invalid if it does not have at least a one person.
The error template comes in the form of a red outline around the grid. I tried setting the ErrorTemplate={x:Null} in the style of the grid provided, but it doesn't seem to work. I tried a lot more tweaks but all in vain.
Has anyone tweaked the metro style? Can anyone help?
regards,
Sid
Hi Sid,
I have been looking into your question and I was wondering whether your error template is applied when no theme is applied on the XamDataGrid.
For more information about styling data errors, you can look at the following link from our online documentation :
http://help.infragistics.com/Help/NetAdvantage/WPF/2013.1/CLR4.0/html/xamDataPresenter_Styling_Data_Errors.html
Looking forward to hearing from you.
Hey Yanko,
The link provided illustrates error of a given column. However, I am concenrned with error of the whole grid.
I wish I could send you a screenshot, but I can't see any link to upload a picture here. It says imahe URL. Does this mean I need to upload the image somewhere else and give the url here? Where do I upload the image?
Hello,
I am checking if this is still an issue for you.
If you require any further assistance please do not hesitate to ask.
Here is a screenshot of the red border that appears with the grid. You can see I have already added an error message appearing in red below the grid. I want to remove the border.
I am using the style provided here.
Adding handler of EditModeStarted of your grid, will just hide adorner layer on which this border appear. Struggled several hours to find who creates it :)
private void DataPresenterBase_OnEditModeStarted(object sender, EditModeStartedEventArgs e) { var contentPresenter = VisualTreeUtil.FindParent<ContentPresenter>(this); var al = AdornerLayer.GetAdornerLayer(contentPresenter); al.Visibility = Visibility.Hidden; }