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

SearchGrid and Custom Background

2 Answers 38 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 2
Veteran
Marco asked on 01 Mar 2018, 06:18 PM

Hello,

I have an issue about the new search support functionnality in the scheduler.

On the grid displaying the result of a search, there is a column based on the background of the appointements which display a color and a displayname defined by Backgrounds property of the Scheduler and the value set in an appointement.

It have made the following customization with theses backgrounds to fit my need.

' Redefine the background list of Appointement
        Dim vacancesbackground As AppointmentBackgroundInfo = Me.AbsenceScheduler.Backgrounds(0)
        With vacancesbackground
            .Id = Absence.TypeOfAbsence.Vacance '=1
            .DisplayName = EnumHelper.GetDescription(Absence.TypeOfAbsence.Vacance)
        End With
        Dim maladiebackground As AppointmentBackgroundInfo = Me.AbsenceScheduler.Backgrounds(1)
        With maladiebackground
            .Id = Absence.TypeOfAbsence.Maladie '=2
            .DisplayName = EnumHelper.GetDescription(Absence.TypeOfAbsence.Maladie)
        End With
        Dim absencebackground As AppointmentBackgroundInfo = Me.AbsenceScheduler.Backgrounds(10)
        With absencebackground
            .Id = Absence.TypeOfAbsence.Absence '=3
            .DisplayName = EnumHelper.GetDescription(Absence.TypeOfAbsence.Absence)
        End With
        Dim congebackground As AppointmentBackgroundInfo = Me.AbsenceScheduler.Backgrounds(9)
        With congebackground
            .Id = Absence.TypeOfAbsence.Conge '=4
            .DisplayName = EnumHelper.GetDescription(Absence.TypeOfAbsence.Conge)
        End With
 
        Me.AbsenceScheduler.Backgrounds.Clear()
        Me.AbsenceScheduler.Backgrounds.Add(vacancesbackground)
        Me.AbsenceScheduler.Backgrounds.Add(maladiebackground)
        Me.AbsenceScheduler.Backgrounds.Add(absencebackground)
        Me.AbsenceScheduler.Backgrounds.Add(congebackground)

 

They are correctly displayed in the result grid except for the one with the Id "1" which display a transparent color and no text.

I'm not really surprised that there is a "special treatment" for this value as the default values 1 of the backgrounds is defined as "None" but is there a way to handle this ? I have attached a exemple screenshot (Record with blank Type should have "Vacances" and blue color)

Thanks for you support

Marco Guignard

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 05 Mar 2018, 12:04 PM
Hello, Marco, 

Thank you for writing.  

According to the provided code snippet you are customizing the already existing backgrounds in RadScheduler. The AppointmentBackgroundInfo with Id=1 is reserved for 'None'. It doesn't have colors specified in the object. That is why it is displayed with an empty color. If you need to display another color, I would recommend you to create a brand new AppointmentBackgroundInfo with the desired color where its ID is not identical with AppointmentBackground.None.
Dim vacancesbackground As AppointmentBackgroundInfo = New AppointmentBackgroundInfo()
With vacancesbackground
    .BackColor = Color.Red
    .BackColor2 = Color.Red
    .ForeColor = Color.Black
    .BorderColor = Color.Black
    .Id = 20
    .DisplayName = "Vacances"
End With
Me.RadScheduler1.Backgrounds.Add(vacancesbackground)

I hope this information helps. Should you have further questions I would be glad to help. 
 
 Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Marco
Top achievements
Rank 2
Veteran
answered on 05 Mar 2018, 02:08 PM

Hello, Dess

Thank you for answering,

That's what I was thinking about, I should avoid using the ID 1 value for my "custom" Background.

Have a nice day.

Tags
Scheduler and Reminder
Asked by
Marco
Top achievements
Rank 2
Veteran
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Marco
Top achievements
Rank 2
Veteran
Share this question
or