Welcome to the Xceed Community | Help
Community Search  
More Search Options

How to set error tooltip content? Part II

Sort Posts: Previous Next
  •  08-14-2012, 2:01 PM Post no. 32561

    How to set error tooltip content? Part II

    I'm using a NumericTextBox for editing a cell. I have MinValue and MaxValue set to 0 and 100. When I enter a value outside the range, an error indicator appears around the cell, and what looks like a tooltip over the row header. But when I hover over that tooltip, there is no message. I can't figure out how to set the content for that tooltip.

     I've read the validation topics in the docs, but to be honest, find them to be confusing.

  •  08-14-2012, 3:26 PM Post no. 32564 in reply to 32561

    Re: How to set error tooltip content? Part II

    Hi james, 

     

    To return a custom validation message, you’ll need to return
            new ValidationResult( false, "My custom message." );
    in the validation function in the code-behind.

     

    For more information, you may check the example here:
    http://doc.xceedsoft.com/products/XceedWpfDataGrid/Xceed.Wpf.DataGrid.v4.3~Xceed.Wpf.DataGrid.ValidationRules.CellValidationRule.html

     

     If this doesn't help you, can you please provide us of a snippet or a little demo project so we can have a better grasp of what you are trying to do? 
    Thanks


    Sebastien Lebreux
    Technical Support
    Xceed Software
  •  08-15-2012, 2:33 PM Post no. 32566 in reply to 32564

    Re: How to set error tooltip content? Part II

    Sebastien,

    I'm not using a validation rule, I set the MinValue and MaxValue properties on my NumericTextBox. If I enter a value outside that range, then the cell shows the red border, and the red icon appears over the row header. I realize now that there is a a tooltip message, but it only appears when I hover over the cell. That marker on the row header doesn't show the tooltip. Maybe that is good, if a row has multiple errors, which tooltip would it show? I don't know, I haven't worked with the grid for very long.

    In any event, the tooltip over the cell is not very helpful. It says "The value "" could not be converted". Of course what I would like it to say is something like "The value entered is less that the MinValue property" or something. I just went ahead and did a cell validation rule, so I can supply my own custom message (which would be better, anyway, than the one in the previous sentence). I removed the MinValue and MaxValue settings on the NumericTextBox and delegate all validation to this rule.

    Thanks.

    Jim

  •  08-16-2012, 8:56 AM Post no. 32571 in reply to 32566

    Re: How to set error tooltip content? Part II

    Hi james,

     

    Can you send me a little demo project so I can have a better look of what you are trying to do please?

     

     Thanks 


    Sebastien Lebreux
    Technical Support
    Xceed Software
  •  08-16-2012, 10:48 AM Post no. 32573 in reply to 32571

    Re: How to set error tooltip content? Part II

    I've solved the current issue. It's obvious that the error icon on the row header is not intended to show a tooltip, and by using a custom rule I'm supplying the message I want for the tooltip over the cell.

    What I need help with now is on this other post, to which there's been no answer so far:

    http://xceed.com/CS/forums/thread/32562.aspx

View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.