SearchGrid and Custom Background

3 posts, 1 answers
  1. Marco
    Marco avatar
    97 posts
    Member since:
    Apr 2011

    Posted 01 Mar 2018 Link to this post


    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


    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. Answer
    Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    4086 posts

    Posted 05 Mar 2018 Link to this post

    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

    I hope this information helps. Should you have further questions I would be glad to help. 
    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.
  3. Marco
    Marco avatar
    97 posts
    Member since:
    Apr 2011

    Posted 05 Mar 2018 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    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.

Back to Top