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

ChkAllDay CheckBox

2 Answers 53 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Al
Top achievements
Rank 1
Al asked on 17 Apr 2012, 09:27 PM
I have created a custom appointment edit form.  I have created my own fields as well as disabling inherited fields that I did not need.  For the fields that I did not need, I moved them to an empty part of the form, set the Visible property to False and erased anything in the text property.

However, I did this with the chkAllDay CheckBox.  Set the Visible property to false and erased the text in the Text Property.  The form designer reflects these changes - no text shows up next to the CheckBox.   Anytime that I run my program and use the form this CheckBox is visible on the form, and the original text is displayed.

I have a simple fix for this.  In the MouseMove Event handling I use the following code:
If (chkAllDay.Visible = True) Then
            chkAllDay.Visible = False
        End If


This will make the control not visible as desired anytime the user moves the mouse.

I just wanted to point out a possible bug - or if someone could show me what I'm doing wrong.

Thanks!

2 Answers, 1 is accepted

Sort by
0
Al
Top achievements
Rank 1
answered on 18 Apr 2012, 10:58 PM
I have found that using the form load setting 'chkAllDay.Visible = false' does not work.  However,
Protected Overrides Sub OnLoad(ByVal e As EventArgs)
        MyBase.OnLoad(e)
        Me.chkAllDay.Visible = False
    End Sub
 

does work correctly.  
0
Ivan Todorov
Telerik team
answered on 20 Apr 2012, 03:36 PM
Hi Allen,

Thank you for contacting us.

This is not an issue but rather a particular behavior of the dialog's base implementation. In the base Load handler all strings across the dialog are localized. This means that their Text is changed according to the current RadSchedulerLocalizationProvider. You can override the LocalizeDialog method to modify the text of the controls and this would be the best way to do this.

As to the visibility of the chkAllDay checkbox, it is modified internally depending on some settings. However, you can override the methods that modify its visibility to keep it hidden. The following code snippet demonstrates how you can achieve this:
public class MyEditDialog : EditAppointmentDialog
{
    protected override void LocalizeDialog(RadSchedulerLocalizationProvider localizationProvider)
    {
        base.LocalizeDialog(localizationProvider);
        this.chkAllDay.Text = "";
    }
 
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        this.chkAllDay.Visible = false;
    }
 
    public override void ShowRecurrenceDialog()
    {
        base.ShowRecurrenceDialog();
        this.chkAllDay.Visible = false;
    }
}

I hope you find this information useful. Feel free to write back if you have any further questions.

All the best,
Ivan Todorov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
Scheduler and Reminder
Asked by
Al
Top achievements
Rank 1
Answers by
Al
Top achievements
Rank 1
Ivan Todorov
Telerik team
Share this question
or