CellValidating ErrorMessage does not show or is invisible.

0 Answers 93 Views
GridView ToolTip
Scott
Top achievements
Rank 1
Iron
Scott asked on 11 Jan 2024, 04:40 PM | edited on 11 Jan 2024, 04:46 PM

In my `telerik:RadGridView`, I have configured a `CellValidating="RadGridView_CellValidating"` callback.  It successfully catches a validation error, which then invokes this code:

e.IsValid = false;
e.ErrorMessage = "Enter a valid URL with 'https://' or 'http://'";

The cell does properly receive a red border, and what looks like a tool-tip notation in the top right corner.  However, unfortunately, I am unable to see the tool-tip, regardless if I hover or click on the tool-tip.  What are perhaps the top three to five reasons this might be happening?

It is specifically the "Documentation" column above, which is a `GridViewHyperlinkColumn`, which is failing validation...with no tool-tip showing.  To be clear, actually none of the columns have a working or "showable" tool-tip.  Even so, here is the code specifically for my "Documentation" column:

    <telerik:GridViewHyperlinkColumn
        IsReadOnly="{Binding IsEditModeWithPermissions, Converter={StaticResource InverseBooleanConverter}}"
        CellStyle="{StaticResource GridViewCellStyleStretch}" IsCustomSortingEnabled="False"
        ValidatesOnDataErrors="InViewMode"
        UniqueName="Documentation"
        MinWidth="80" MaxWidth="350" Width="150"
        DataMemberBinding="{Binding Documentation}"
        Name="DocumentationColumn" Header="Documentation">
        <telerik:GridViewHyperlinkColumn.CellTemplate>
            <DataTemplate>
                <TextBlock Text="{Binding DocumentationFormatted, StringFormat='{}{0}'}"/>
            </DataTemplate>
        </telerik:GridViewHyperlinkColumn.CellTemplate>
        <telerik:GridViewHyperlinkColumn.CellEditTemplate>
            <DataTemplate>
                <telerik:RadComboBox x:Name="DocumentationBox"
                    Text="{Binding Documentation, Mode=TwoWay}" KeyDown="RadComboBox_PreviewKeyDown"
                    IsTextSearchEnabled="True" TextSearchMode="StartsWith" OpenDropDownOnFocus="True"
                    StaysOpenOnEdit="False" Loaded="RadComboBox_Loaded" IsEditable="True" >
                    <telerik:RadComboBox.Resources>
                        <Style TargetType="TextBox">
                            <Setter Property="MaxLength" Value="{Binding DocumentationColumnWidth}" />
                        </Style>
                    </telerik:RadComboBox.Resources>
                </telerik:RadComboBox>
            </DataTemplate>
        </telerik:GridViewHyperlinkColumn.CellEditTemplate>
    </telerik:GridViewHyperlinkColumn>

And here is the RadGridView initial declaration:

    <telerik:RadGridView Grid.Row="1"
        CellValidating="RadGridView_CellValidating"
        BorderThickness="{Binding GridBorderThickness}"
        SelectedItem="{Binding SelectedLineItem, Mode=TwoWay}" Pasting="UxGrid_OnPasting"
        SelectionChanged="UxGrid_OnSelectionChanged" CopyingCellClipboardContent="UxGrid_OnCopyingCellClipboardContent"
        RowIndicatorVisibility="Visible"
        ValidatesOnDataErrors="InViewMode"
        EditTriggers="CellClick"
        ActionOnLostFocus="CommitEdit" Name="uxGrid"
        PreparingCellForEdit="uxGrid_PreparingCellForEdit" Deleted="UxGrid_OnDeleted"
        CellEditEnded="uxGrid_CellEditEnded"
        KeyDown="GridKeyDown"
        ScrollMode="Deferred"
        IsReadOnly="{Binding IsGridEditable, Converter={StaticResource InverseBooleanConverter}}"
        CanUserDeleteRows="{Binding CanEditNotReleased}" CanUserInsertRows="False"
        AreRowDetailsFrozen="True" EnableColumnVirtualization="False"
        RowDetailsVisibilityMode="{Binding RowDetailsVisibility}"
        DataLoaded="UxGrid_OnDataLoaded"
        RowEditEnded="RadGridViewRowEditEnded" BeginningEdit="RadGridViewBeginningEdit"
        AlternationCount="2" AutoGenerateColumns="False" 
        ItemsSource="{Binding LineItemsView, UpdateSourceTrigger=PropertyChanged}" SourceUpdated="uxGrid_SourceUpdated_1"
        Loaded="uxGrid_Loaded"
        LoadingRowDetails="UxGrid_OnLoadingRowDetails"
        ColumnWidthChanged="GridViewDataControl_OnColumnWidthChanged"
        DataContext="{Binding}"
        ColumnReordering="uxGrid_ColumnReordering"
        CanUserSortColumns="{Binding IsEditMode, Converter={StaticResource InverseBooleanConverter}}"
        IsFilteringAllowed="{Binding IsEditMode, Converter={StaticResource InverseBooleanConverter}}">
Martin Ivanov
Telerik team
commented on 15 Jan 2024, 05:02 PM

I have tested the code, but on my side the tooltip is shown as expected. You can check the attached project see if I am missing anything.

No answers yet. Maybe you can help?

Tags
GridView ToolTip
Asked by
Scott
Top achievements
Rank 1
Iron
Share this question
or