in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

C1DateEdit.Clear() throws error

Last post 07-24-2008 1:07 AM by C1_JohnAd. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-28-2008 9:35 AM

    C1DateEdit.Clear() throws error

    Hi there.
    I have a program with a C1DockingTab with three tab pages. I have put C1DateEdit controls on all tab pages.
    Sometimes I want to clear the C1DateEdit controls and I use the Clear() method. I have set the EmptyAsNull to True so I do not get the The entered string cannot be parsed... error message.
    But when I use the Clear() method on C1DateEdit controls that are on an other tab page than the one visible I get an error message saying "Can't assign text to readonly, disabled or hidden C1Input control when its Text property is not detached."
    I get the same error if I set Enabled = false on the Panel control that contains the C1DateEdit controls. I have to enable the Panel in order to use the Clear() method.
    I have read that the textbox in the C1DateEdit control inherits from the TextBox control. However the Clear() method on the TextBox method works fine with not visible TextBoxes. Could there be a bug in the C1DateEdit?
    To solve my problem I set the C1DateEdit.Value = null and it works fine - but why is there a Clear() method if it works better setting the value = null.

    Best regards,
    SteffenJ

    SteffenJ
    Filed under:
  • 07-24-2008 1:07 AM In reply to

    Re: C1DateEdit.Clear() throws error

    Hi Steffen,
     
    Please test the scenario with the latest build of C1Input for .Net 2.0. Which is available for download at followign location:
     
     
    Hope this helps.
     
    Regards,
    John Adams
     
    <SteffenJ_2> wrote in message news:205319@10.0.1.98...

    Hi there.
    I have a program with a C1DockingTab with three tab pages. I have put C1DateEdit controls on all tab pages.
    Sometimes I want to clear the C1DateEdit controls and I use the Clear() method. I have set the EmptyAsNull to True so I do not get the The entered string cannot be parsed... error message.
    But when I use the Clear() method on C1DateEdit controls that are on an other tab page than the one visible I get an error message saying "Can't assign text to readonly, disabled or hidden C1Input control when its Text property is not detached."
    I get the same error if I set Enabled = false on the Panel control that contains the C1DateEdit controls. I have to enable the Panel in order to use the Clear() method.
    I have read that the textbox in the C1DateEdit control inherits from the TextBox control. However the Clear() method on the TextBox method works fine with not visible TextBoxes. Could there be a bug in the C1DateEdit?
    To solve my problem I set the C1DateEdit.Value = null and it works fine - but why is there a Clear() method if it works better setting the value = null.

    Best regards,
    SteffenJ


    SteffenJ

    http://helpcentral.componentone.com/cs/forums/p/75378/205319.aspx#205319

Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.