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

Cell validation in RadTreeListView

2 Answers 72 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Smita
Top achievements
Rank 1
Smita asked on 16 Apr 2012, 05:55 AM
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 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 16 Apr 2012, 08:03 AM
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 >>

0
Smita
Top achievements
Rank 1
answered on 16 Apr 2012, 09:35 AM
<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.
Tags
TreeListView
Asked by
Smita
Top achievements
Rank 1
Answers by
Maya
Telerik team
Smita
Top achievements
Rank 1
Share this question
or