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
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; }
Hi Sid,
I have been looking into your issue and I was wondering whether you can attach a sample application that shows exactly your scenario. This way I will can provide you with more accurate assistance on this matter.
Looking forward to hearing from you.
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.
Hello,
I am checking if this is still an issue for you.
If you require any further assistance please do not hesitate to ask.
Hello Sid,
Thank you for your reply. You can add a screenshot or any other file to your post as after pressing the ‘Reply’ button, select ‘Options’ tab.
Could you please tell me whether your issue occurs only with ‘Metro’ theme set ?