This is a migrated thread and some comments may be shown as answers.

RowStyle and CellValidating event

0 Answers 11 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 26 Feb 2012, 07:48 PM
I have a applied a template on a GridView row. This template contains a TextBox. When I edit text in the TextBox, the CellValidating event is not fired as would be the case with a non-templated GridView row. Is there a way to wire up CellValidating to a templated row?

In the following example, I would like the RadGridViewCellValidating handler to be called when text in the TextBox in the DocumentRowTemplate is changed. Is this possible?

<Window
    x:Class="GridViewTest.MainWindow"
    Title="MainWindow" Height="350" Width="525">
    <Window.Resources>
        <ControlTemplate x:Key="DocumentRowTemplate">
            <TextBox Text="{Binding MyText}"/>
        </ControlTemplate>
 
        <Style x:Key="DocumentRowStyle" TargetType="{x:Type telerik:GridViewRow}">
            <Setter Property="Template" Value="{DynamicResource DocumentRowTemplate}"/>
        </Style>
    </Window.Resources>
 
    <telerik:RadGridView
        ItemsSource="{Binding MyEntities}"
        AutoGenerateColumns="False"
        RowStyle="{DynamicResource DocumentRowStyle}"
        CellValidating="RadGridViewCellValidating"/>
     
</Window>

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Erik
Top achievements
Rank 1
Share this question
or