in

C1 Community

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

Adding custom labels not working properly, generates a new key each time application is run

Last post 07-24-2008 9:49 PM by Audiator. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-29-2008 10:59 AM

    Adding custom labels not working properly, generates a new key each time application is run

    I am having a problem adding custom labels to the scheduler.  The actual problem is not with adding or creating the labels, that works fine.  However, when I create an appointment using one of the custom labels the the label's key is saved in the appointment properties.  This creates a problem when I run the application again.  My custom labels are added at runtime, and each time the application runs it generates a key different from the previous run of the application.  When my appointments are loaded from the database the key in the appointments property is different from the key for the labels added on this run.  Any help would be greatly appreciated.

  • 04-29-2008 1:31 PM In reply to

    Re: Adding custom labels not working properly, generates a new key each time application is run

    >I am having a problem adding custom labels to the scheduler. The actual problem is not
    >with adding or creating the labels, that works fine. However, when I create an
    >appointment using one of the custom labels the the label's key is saved in the
    >appointment properties. This creates a problem when I run the application again. My
    >custom labels are added at runtime, and each time the application runs it generates a key
    >different from the previous run of the application. When my appointments are loaded from
    >the database the key in the appointments property is different from the key for the
    >labels added on this run. Any help would be greatly appreciated.

    I don't know why you create your labels at run-time. Perhaps you can hard-code creation of
    DataTable or custom collection with your labels (including unique key for each label) and
    set DataStorage.LabelStorage properties (mappings and DataSource) to get data from this
    object. In such case, your labels will always have the same key.
  • 04-29-2008 1:43 PM In reply to

    Re: Adding custom labels not working properly, generates a new key each time application is run

    I'm creating the labels at run-time because I haven't figured out any other way to do it.  The information to create the labels (label color, text, caption) is stored in a database.  I am attempting to replace the predefined labels with my own labels appropriate to my application.  I currently clear the LabelCollection, iterate through my label table creating labels, and add the labels to the LabelCollection.  If there is a different/better way to do this I'd be interested to know.

  • 04-29-2008 4:07 PM In reply to

    Re: Adding custom labels not working properly, generates a new key each time application is run

    > I'm creating the labels at run-time because I haven't figured out any other way to do
    > it. The information to create the labels (label color, text, caption) is stored in a
    > database. I am attempting to replace the predefined labels with my own labels
    > appropriate to my application. I currently clear the LabelCollection, iterate through
    > my label table creating labels, and add the labels to the LabelCollection. If there is
    > a different/better way to do this I'd be interested to know.

    You can bind LabelStorage to your data in the same way as you do with appointments.
    Look at FullBound sample here: http://helpcentral.componentone.com/Sample.aspx?ID=VUOTZW
  • 07-24-2008 9:49 PM In reply to

    Re: Adding custom labels not working properly, generates a new key each time application is run

    C1_IrinaP:
    I don't know why you create your labels at run-time. Perhaps you can hard-code creation of
    DataTable or custom collection with your labels (including unique key for each label) and
    set DataStorage.LabelStorage properties (mappings and DataSource) to get data from this
    object. In such case, your labels will always have the same key.

     

    how??

    Ok... i found a sulution... :-)

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