Home Forums WPF controls Xceed DataGrid for WPF How to set error tooltip content? Part II

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #40356 |

    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.

    Imported from legacy forums. Posted by James (had 1089 views)

    Xceed Support
    Member
    Post count: 5658

    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

    Imported from legacy forums. Posted by Sebastien [Xceed] (had 632 views)

    User (Old forums)
    Member
    Post count: 23064

    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

    Imported from legacy forums. Posted by James (had 169 views)

    Xceed Support
    Member
    Post count: 5658

    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 

    Imported from legacy forums. Posted by Sebastien [Xceed] (had 176 views)

    User (Old forums)
    Member
    Post count: 23064

    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

    Imported from legacy forums. Posted by James (had 1035 views)

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.