RadGridView CellEditTemplate Validation InEditMode invisible

1 Answer 81 Views
GridView
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
Benedikt asked on 23 Jul 2024, 08:35 AM

Hey,

since the last Update, my GridViews with a CellEditTemplate (for example DateTimePickers or MaskedTextInputs) dont show the red Validation Error indicators anymore, if ValidatesOnDataErrors is set to InEditMode.

If you hover over the location where the error should show you can still see it, but no red indicator whatsoever.

If ValidatesOnDataErrors is set to ViewMode it works.
If no CellEditTemplate is set, it works too.

Heres the code of the gridview:

        <telerik:RadGridView
            x:Name="rgv"
            GroupRenderMode="Flat"
            ShowGroupPanel="False"
            FilteringMode="Popup"
            ShowSearchPanel="False"
            CanUserSearch="False"
            ValidatesOnDataErrors="InEditMode"
            AlternationCount="2"
            ActionOnLostFocus="CommitEdit"
            CanUserDeleteRows="True"
            IsSynchronizedWithCurrentItem="True"
            ShowColumnFooters="True"
            SelectionMode="Single"
            IsPropertyChangedAggregationEnabled="False"
            VirtualizingPanel.VirtualizationMode="Recycling"
            NewRowPosition="Top"
            AutoGenerateColumns="False"
            >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn
                    DataMemberBinding="{Binding RechnungsNr}"
                    Header="Rechnung Nr."
                    TextWrapping="Wrap"
                    HeaderTextWrapping="Wrap"
                    Width="100"
                    >
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>
                            <telerik:RadMaskedTextInput
                                Value="{Binding RechnungsNr, Mode=TwoWay, UpdateSourceTrigger=Explicit}"    
                                maskedInput:MaskedInputExtensions.MaxTextLength="255"
                                Mask=""
                                MinWidth="100"
                                InputBehavior="Insert"
                                IsClearButtonVisible="False"
                                />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:CountFunction Caption="Anzahl:  " ResultFormatString="{}{0:N0}" />
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

 

And also the whole sample project:
https://we.tl/t-11ppqbB7EG

 

Did I miss something I have to change after the update?

Greetings
Benedikt

1 Answer, 1 is accepted

Sort by
1
Accepted
Stenly
Telerik team
answered on 23 Jul 2024, 10:33 AM

Hello Benedikt,

Since the IDataErrorInfo interface is implemented in the sample project, may I ask if you could try setting the ValidatesOnDataErrors property of the Binding for the Value property of the RadMaskedTextInput to True?

<telerik:RadGridView.Columns>
    <telerik:GridViewDataColumn
        DataMemberBinding="{Binding RechnungsNr}"
        Header="Rechnung Nr."
        TextWrapping="Wrap"
        HeaderTextWrapping="Wrap"
        Width="100">
        <telerik:GridViewDataColumn.CellEditTemplate>
            <DataTemplate>
                <telerik:RadMaskedTextInput
                    Value="{Binding RechnungsNr, Mode=TwoWay, UpdateSourceTrigger=Explicit, ValidatesOnDataErrors=True}"    
                    maskedInput:MaskedInputExtensions.MaxTextLength="255"
                    Mask=""
                    MinWidth="100"
                    InputBehavior="Insert"
                    IsClearButtonVisible="False"
                    />
            </DataTemplate>
        </telerik:GridViewDataColumn.CellEditTemplate>
        <telerik:GridViewDataColumn.AggregateFunctions>
            <telerik:CountFunction Caption="Anzahl:  " ResultFormatString="{}{0:N0}" />
        </telerik:GridViewDataColumn.AggregateFunctions>
    </telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>

This will produce the following result:

I hope the provided information will be of help to you.

Regards,
Stenly
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
commented on 23 Jul 2024, 01:27 PM

Hi Stenly,

your idea makes it a little better.
I also changed the UpdateSourceTrigger to PropertyChanged, this combined makes it fine.

Thank you :)

Greetings
Benedikt

Tags
GridView
Asked by
Benedikt
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Stenly
Telerik team
Share this question
or