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

InputScope setting for DataForm fields

5 Answers 28 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 1
Daniel asked on 21 Aug 2013, 05:56 PM
Is there a straightforward way to set the InputScope for Fields?

I know i must be missing something simple.  This is such an awesome control, i can't imagine not being able to say a field is an email address and use the email keyboard...

your assistance is appreciated,

Dan

5 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 23 Aug 2013, 07:08 AM
Hi Daniel,

Thanks for writing.

InputScropes can be set via Styles. Each DataField instance exposes a EditorStyles property which can be used to define a style targeting the editor's type. For instance, if your DataField is associated with a string property, a RadTextBox instance will be created as an editor by default. So you can define a Style targeting the RadTextBox type, set the InputScope via it, and add it to the EditorStyles collection. This can happen easily in XAML.

I hope this helps.

Regards,
Deyan
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
KI performance
Top achievements
Rank 1
answered on 28 Aug 2013, 09:55 AM
Hi there,

I have the same problem. could you show a code-example? i always getting "line 0, column 0 " Xaml Errors!

Thanks!
0
Deyan
Telerik team
answered on 28 Aug 2013, 10:25 AM
Hi Sascha,

Here's a very simple XAML snippet that demonstrates how this is done:

<telerikInput:DataField.EditorStyles>
    <Style TargetType="telerikPrimitives:RadTextBox">
        <Setter Property="InputScope" Value="EmailUserName"/>
    </Style>
</telerikInput:DataField.EditorStyles>

I hope this helps.

Regards,
Deyan
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Kevin
Top achievements
Rank 1
answered on 15 Nov 2013, 04:39 PM
This does not appear to be working in the latest release (2013.3.1016.3040). Is this a known bug?

I've tried setting the InputScope style exactly as shown, but it's always ignored no matter what scope value I try to use. I only ever get the standard input keyboard. Here's my entire DataField:

<telerikInput:DataField Header="username" TargetProperty="UserName">
    <telerikInput:DataField.EditorStyles>
        <Style TargetType="telerikPrimitives:RadTextBox">
            <Setter Property="Watermark" Value="username or email"/>
        </Style>
        <Style TargetType="telerikPrimitives:RadTextBox">
            <Setter Property="InputScope" Value="EmailUserName" />
        </Style>
    </telerikInput:DataField.EditorStyles>
    <telerikInput:DataField.Validators>
        <telerikInput:NonEmptyStringValidator/>
    </telerikInput:DataField.Validators>
</telerikInput:DataField>
0
Kevin
Top achievements
Rank 1
answered on 15 Nov 2013, 04:46 PM
Nevermind that last post. PEBKAC.  :-)

I realized that I had copy/pasted the entire <Style> block for the watermark to add the style for the InputScope instead of just adding another Setter to the existing <Style>. Once I fixed that it works fine ... obviously. :-)
Tags
DataForm
Asked by
Daniel
Top achievements
Rank 1
Answers by
Deyan
Telerik team
KI performance
Top achievements
Rank 1
Kevin
Top achievements
Rank 1
Share this question
or