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

[ReadOnly] CheckBox

1 Answer 187 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Mikas
Top achievements
Rank 1
Mikas asked on 10 Nov 2017, 07:19 PM

I have the following but it appears the ReadOnly Attribute is ignored?

 

        [DisplayOptions(Position = 3, ColumnPosition = 0, Header = "Completed")]
        [ReadOnly]
        public bool COMPLETED { get; set; }

 

 

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 10 Nov 2017, 10:57 PM
Hello Mike,

I'm not able to replicate the issue with the provided information.


Demo

I have created an example, find it attached. I used the following:

             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:telerikInput="clr-namespace:Telerik.XamarinForms.Input;assembly=Telerik.XamarinForms.Input"
             x:Class="ReadOnlyProperties.Portable.StartPage">
     
    <Grid>
        <telerikInput:RadDataForm  x:Name="dataForm" />
    </Grid>
</ContentPage>

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace ReadOnlyProperties.Portable
{
    public partial class StartPage : ContentPage
    {
        public StartPage()
        {
            InitializeComponent();
 
            dataForm.Source = new Job();
        }
    }
 
    public class Job
    {
        [DisplayOptions(Position = 1, ColumnPosition = 0, Header = "Job Title")]
        public string JobTitle { get; set; }
 
        [DisplayOptions(Position = 2, ColumnPosition = 0, Header = "Job Id")]
        public int JobId { get; set; }
 
        [DisplayOptions(Position = 3, ColumnPosition = 0, Header = "Completed")]
        [ReadOnly]
        public bool COMPLETED { get; set; }
    }
}


and result is as expected at runtime, the CheckBox/Swicth is disabled.

Here is a screenshot of iOS and UWP side-by-side:





Possible Solution

The only thing I can think of at this point, is that maybe you recently added the attribute to the class, but the deployed app was using an outdated build of the PCL. Xamarin is known to do this, to see if this is the case, do a clean and rebuild of both PCL and platform projects. Then, redeploy.


Next Steps

If that doesn't fix it, please submit a support ticket here with a reproducible so that we can replicate it on our end for further investigation. If it's easier, you can use my demo to replicate it and send us that instead.

Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DataForm
Asked by
Mikas
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or