Cell validation in RadTreeListView

3 posts, 0 answers
  1. Smita
    Smita avatar
    2 posts
    Member since:
    Apr 2012

    Posted 16 Apr 2012 Link to this post

    I am using RadTreeListView, provided the Xaml below.
    I wanted to do validation for the text box column, similar to what is provided for GridView column, 'CellValidating' event where if validation logic fails, text box shows a comment, and the border will become red. Is this supported in RadTreeListView, how can I implement in my code?

     <telerik:RadTreeListView x:Name="MyTree" AutoGenerateColumns="False">
     <telerik:RadTreeListView.Columns>
                        <telerik:GridViewDataColumn x:Name="ObjNameColumn" Header="Name" DataMemberBinding="{Binding Name}" >
                            <telerik:GridViewDataColumn.CellStyle>
                                <Style TargetType="telerik:GridViewCell">
                                    <Setter Property="Template">
                                        <Setter.Value>
                                            <ControlTemplate>
                                                <Border BorderBrush="LightGray" BorderThickness="0,0,1,0">
                                                    <TextBox x:Name="txtBox_NewInstanceName"                                                   
                                                               HorizontalAlignment="Center" VerticalAlignment="Center"    
                                                                Text="{Binding Path=Name, Mode=TwoWay, UpdateSourceTrigger=LostFocus}">
                                                    </TextBox>
                                                </Border>
                                            </ControlTemplate>
                                        </Setter.Value>
                                    </Setter>
                                </Style>
                            </telerik:GridViewDataColumn.CellStyle>
                        </telerik:GridViewDataColumn>
    ...
    ...


  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 16 Apr 2012 Link to this post

    Hello Smita,

    You can implement validation in RadTreeListView in the same way as in RadGridView. Please refer to our online documentation for a reference. 

    Regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. Smita
    Smita avatar
    2 posts
    Member since:
    Apr 2012

    Posted 16 Apr 2012 Link to this post

    <telerik:RadTreeListView x:Name="MyTree" AutoGenerateColumns="False" CellValidating="MyTree_CellValidating">

    I have tried CellValidating for RadTreeListView but it never gets hit. That's why I was not sure if I am using it the right way or if it's not supported for TreeListView. Could you provide some code snippet for RadTreeListView where this has been implemented.
Back to Top