Change Row height of Resources

Hi Team,

How do I reduce the amount of white space above and below the names of resources in Timeline view of the Scheduler as indicated in the included image?

Image_8650_1706758426627


XAML:

@using Dash.Common.Models
@using Syncfusion.Blazor.Schedule

@inject WorkerRepository _workerDb

<SfSchedule TValue="SupportModel" @bind-SelectedDate="@CurrentDate" >
    <ScheduleGroup Resources="@Resources"></ScheduleGroup>
    <ScheduleResources>
        <ScheduleResource
            TItem="WorkerModel"
            TValue="int"
            DataSource="@Workers"
            Field="OwnerId"
            Title="Owner"
            Name="Workers"
            TextField="WorkerName"
            IdField="Id">
        </ScheduleResource>
    </ScheduleResources>
    <ScheduleEventSettings DataSource="@Appointments">
        <Template>
            <table >
                <tr>
                    <td>Participant: </td>
                    <td>@((context as SupportModel).Subject)</td>
                </tr>
               
            </table>
        </Template>
    </ScheduleEventSettings>


    <ScheduleViews>
        <ScheduleView Option="View.TimelineDay"></ScheduleView>
    </ScheduleViews>
</SfSchedule>


Code behind:

public partial class Cal
{
    public DateTime CurrentDate = DateTime.Today;
    public List<SupportModel> Appointments { get; set; } = new List<SupportModel>();
    public List<WorkerModel> Workers { get; set; } = new List<WorkerModel>();

    public string[] Resources { get; set; } = { "Workers" };

    protected override void OnInitialized()
    {
        Workers = _workerDb.GetAllWorkers();
    }
}

Thanks in advance for your help


3 Replies 1 reply marked as answer

VS Venkateshwaran Saravanakumar Syncfusion Team February 1, 2024 03:24 PM UTC

Hi Steve,


You can achieve your requirement by overriding the default CSS styles of the scheduler as like the shared code snippet below.


[Index.razor]

<SfSchedule CssClass="timeline-resource-grouping"> </SfSchedule>

 

<style>

    .timeline-resource-grouping.e-schedule .e-timeline-view .e-work-cells,

    .timeline-resource-grouping.e-schedule .e-timeline-view .e-resource-cells {

        height: 40px;

    }

 

    .timeline-resource-grouping.e-schedule .e-appointment,

    .timeline-resource-grouping.e-schedule .e-work-cells .e-appointment,

    .timeline-resource-grouping.e-schedule .e-month-header-wrap .e-day.e-title {

        height: 20px;

    }

 

    .timeline-resource-grouping.e-schedule .e-timeline-view .e-appointment .e-subject,

    .timeline-resource-grouping.e-schedule .e-timeline-month-view .e-appointment .e-subject {

        font-size: 10px;

    }

</style>



image



Regards,

Venkatesh


Marked as answer

ST Steve February 4, 2024 11:19 PM UTC

Thanks for this... it is exactly what I have been trying to do...

Steve.



AK Ashokkumar Karuppasamy Syncfusion Team February 5, 2024 11:32 AM UTC

Hi Steve,

Thank you for the update. We're glad to hear that the provided solution meets your requirements. Please let us know if you need any further assistance.

Regards,
Ashok


Loader.
Up arrow icon