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

EditorTemplate Focus

3 Answers 155 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Adige S.p.A
Top achievements
Rank 1
Adige S.p.A asked on 03 Apr 2014, 02:53 PM
I have defined two datatemplate:


<DataTemplate x:Key="doubleTemplate">
        <local:DoubleTextBox propertyGrid:AutoBindBehavior.UpdateBindingOnElementLoaded="Text"/>
    </DataTemplate>

and
<DataTemplate x:Key="usrDoubleTemplate">
        <GridName="gridRoot">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <local:DoubleTextBox propertyGrid:AutoBindBehavior.UpdateBindingOnElementLoaded="Text"/>           
            <Label Loaded="LabelUnit_Loaded" Grid.Column="1" Margin="2,0" ContentStringFormat="[{0}]"
                   propertyGrid:AutoBindBehavior.UpdateBindingOnElementLoaded="DataContext"/>
        </Grid>
    </DataTemplate>

When enter in editing mode with keyboard, in the first Datatemplate takes the focus on the TextBox, in the second Datatemplate does not take the focus on the TextBox.

The reason may be the grid?

Any solutions?

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 08 Apr 2014, 10:16 AM
Hello,

What is the result if you switch the way the DataTemplates are ordered? Does only the first DataTemplate take the focus on the TextBox? Would you please let me know how exactly have you defined the PropertyGrid and how do you use the DataTemplates?

Regards,
Didie
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Adige S.p.A
Top achievements
Rank 1
answered on 09 Apr 2014, 08:07 AM
The DataTemplates are defined as resources, than the order is not important. Yes, only the first Datatemplate take the focus on the TextBox.

I have defined PropertyDefinition in code behind and to every PropertyDefinition is assigned the EditorTemplate with a DataTemplate defined in resources.
0
Accepted
Dimitrina
Telerik team
answered on 11 Apr 2014, 02:06 PM
Hi,

It seems you use your custom TextBox. I tested the with TextBox and I could not reproduce any problem. Please note I test with the latest version.

The way I defined my PropertyGrid is as follows:
<telerik:RadPropertyGrid x:Name="pg"AutoGeneratePropertyDefinitions="False">
    <telerik:RadPropertyGrid.PropertyDefinitions>
     <telerik:PropertyDefinition DisplayName="Address"
     GroupName="Personal Info" Binding="{Binding Address}" EditorTemplate="{StaticResource doubleTemplate}"/>
     <telerik:PropertyDefinition DisplayName="Address"
 GroupName="Personal Info" Binding="{Binding Address}" EditorTemplate="{StaticResource usrDoubleTemplate}"/>
     </telerik:RadPropertyGrid.PropertyDefinitions>
 </telerik:RadPropertyGrid>

Please note I have used your DataTemplates with the only difference I use a TextBox instead of DoubleTextBox.

Would you please test if you experience the same problem with a TextBox?

Regards,
Didie
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
PropertyGrid
Asked by
Adige S.p.A
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Adige S.p.A
Top achievements
Rank 1
Share this question
or