Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
935
Grid data error image matching ultraValidator error image
posted

Hello,

I have a form with both UltraEditorControls using the UltraValidator and Ultra grid using IDataErroInfo for validation. When the data fails validation, the ultravalidator shows a red x symbol where as the IDataErrorInfo shows a red exclamation mark symbol. For consistency in the UI, I would like these images to match.

Are the infragistic images made available either as a resource file or via any type of method/class/enum that has public access and so I could use it to set the images on the controls to match.

Thanks for any guidance on this. Regards,

Wendy

  • 4940
    Verified Answer
    Offline posted

    If you'd like the editors using the WinValidator to match the red exclamation mark image that the WinGrid uses, you can use the following code snippet.

     

    // Get the assembly reference to the WinGrid assembly
    Assembly wingrid_assembly = Assembly.GetAssembly(typeof(Infragistics.Win.UltraWinGrid.UltraGrid));
    // Get the error image resource from the WinGrid assembly
    Stream error_imagestream = wingrid_assembly.GetManifestResourceStream("Infragistics.Win.UltraWinGrid.DataErrorImage.bmp");
    // Set the error image size to 12x12
    ultraValidator1.ErrorImageSize = new Size(12, 12);
    // Set the error image padding for space between the editor and error image
    ultraValidator1.ErrorImagePadding = 4;
    // Set the error image from the resource image stream
    ultraValidator1.NotificationSettings.Image = Bitmap.FromStream(error_imagestream);
    

    Let me know if this helps you achieve what you've asked or if you have any further questions?