in

C1 Community

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

Question, replacing default labels in LabelCollection

Last post 05-26-2008 9:08 AM by C1_IrinaP. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 05-07-2008 1:27 PM

    Question, replacing default labels in LabelCollection

    What is the best method of replacing the default labels in the LabelCollection with my own custom labels?  I have tried clearing the LabelCollection, then adding my own labels with the desired text and colors(this information is stored in a database).  However,everytime I run the program the labels get a different LableID than on the previous run and the appointments using those labels don't recognize the new ones.  As a workaround I am replacing the text of the default labels in the LabelCollection, but this doesn't seem like a very good permanent solution.  Thanks in advance.

  • 05-08-2008 4:00 AM In reply to

    Re: Question, replacing default labels in LabelCollection

    > What is the best method of replacing the default labels in the LabelCollection with my
    > own custom labels? I have tried clearing the LabelCollection, then adding my own labels
    > with the desired text and colors(this information is stored in a database).
    > However,everytime I run the program the labels get a different LableID than on the
    > previous run and the appointments using those labels don't recognize the new ones. As a
    > workaround I am replacing the text of the default labels in the LabelCollection, but
    > this doesn't seem like a very good permanent solution. Thanks in advance.

    The best way for you is to bind LabelStorage to your data. It can be made in the same way
    as for AppointmentStorage. You should set mappings, DataSource and DataMember properties.
    To have the same label Id every time, you should set mapping of the primary key of your
    labels table to IdMapping (if your key is Guid) or to IndexMapping (if your key is
    integer).
  • 05-08-2008 12:57 PM In reply to

    Re: Question, replacing default labels in LabelCollection

    What kind of value should be stored for the color?  Currently I am storing a hex aRGB value (#FF0000FF) but this doesn't seem to work.

     

    * Nevermind, I found one of the sample databases with Color values in it.  Thanks for your help. 

     

  • 05-08-2008 2:43 PM In reply to

    Re: Question, replacing default labels in LabelCollection

    Binding had no effect on the Label Id.  Every time the application is run the labels come up with different Label Id's than the previous run.  Any appointment made using that label does not have a label selected, or associated with it.  I am assuming the Label Id in AppointmentProperties tells the appointment which label to use, is this right?  I have set up the binding as such:

     <c1sched:NestedPropertySetter PropertyName="DataStorage.LabelStorage.DataSource" Value="{DynamicResource dataSet1}"/>

    <c1sched:NestedPropertySetter PropertyName="DataStorage.LabelStorage.DataMember" Value="TaskType"/>

    <c1sched:NestedPropertySetter PropertyName="DataStorage.LabelStorage.Mappings.IndexMapping.MappingName" Value="PK_TaskType"/>

    <c1sched:NestedPropertySetter PropertyName="DataStorage.LabelStorage.Mappings.ColorMapping.MappingName" Value="TaskColor"/>

    <c1sched:NestedPropertySetter PropertyName="DataStorage.LabelStorage.Mappings.TextMapping.MappingName" Value="TaskDescLong"/>

  • 05-09-2008 8:32 AM In reply to

    Re: Question, replacing default labels in LabelCollection

    I just tried to make a sample. It seems to me, that it is a bug in our code. Your code is
    correct and should work as it is.
    Sorry for inconvenience, we'll make the fix available as soon as possible. If it is not
    critical for you, you can change primary key of your labels table to guid and set
    IdMapping, it should work fine with the current version.
  • 05-26-2008 9:08 AM In reply to

    Re: Question, replacing default labels in LabelCollection

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