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

ReadOnly

3 Answers 125 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 30 Jul 2010, 04:30 AM
I think this is an oversight on the MS controls.

Only some controls have a ReadOnly property e.g. the textBox and derivitaves.

For the standard checkbox you can use the AutoCheck property to achieve the same, but the RadCheckbox does not have that property either

Would it be possible to have a 'ReadOnly' property added to all the controls, what, imo, it should do it allow us to look but not touch, e.g. simular to enable, but still allow scrollbars, dropdowns to work, oh and not to change the colour (so users can still read the data and copy it)


3 Answers, 1 is accepted

Sort by
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 30 Jul 2010, 12:03 PM
The control should still provide a visual clue that it is read-only or else an average User would be confused.

I guess the Microsoft standard is just to disable the control in this case, but I agree that this is sometimes not really nice, especially when you have a lot of checkboxes on a form.

Erwin
0
Chris
Top achievements
Rank 1
answered on 02 Aug 2010, 12:12 AM
Ageed, hence the question about border colours in htis thread http://www.telerik.com/community/forums/winforms/general-discussions/border-colours.aspx 

And yes we do have about 200 checkboxes on one of our forms, just about to add a new form with even more

Chris
0
Boryana
Telerik team
answered on 04 Aug 2010, 02:05 PM
Hello everyone,

Thanks for writing.

Even though RadCheckBox differs from the standard checkBox in the way that it does not have an AutoCheck property, our team can suggest several approaches to achieve such behavior.

The first one refers to handling the ToggleStateChanging event which was designed to allow you cancel the ToggleStateChanging operation. Here is a sample code snippet:
private void radCheckBox1_ToggleStateChanging(object sender, Telerik.WinControls.UI.StateChangingEventArgs args)
{
    if (args.OldValue == Telerik.WinControls.Enumerations.ToggleState.On)
    {
        args.Canceled = true;
    }
}

The second approach simulates readonly mode through setting both the Enabled and UseDefaultDisablePaint properties to false. Thus the user will not be able to change the value of the control. Please have a look at the attached project which demonstrates this approach. Furthermore, you can apply a customized theme which handles the Disabled state of the control.

I hope that you will find one of these approaches helpful. Feel free to extend our controls implementing your own logic if the given suggestions do not meet your requirements.

Best wishes,
Boryana
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
General Discussions
Asked by
Chris
Top achievements
Rank 1
Answers by
erwin
Top achievements
Rank 1
Veteran
Iron
Chris
Top achievements
Rank 1
Boryana
Telerik team
Share this question
or