We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Limit hour range - Day view

Thread ID:

Created:

Updated:

Platform:

Replies:

143245 Mar 11,2019 04:10 PM UTC Mar 12,2019 12:01 PM UTC WinForms 1
loading
Tags: ScheduleControl
Bruno
Asked On March 11, 2019 04:10 PM UTC

Hi! 

I'm using a schedule control only in Day ViewType and after searching in this forum i found nothing about limit the view to a range of hours.


For example, my program only works in hours between 8am and 4pm, I want to show only this range and not the whole day, this can be done?


Thanks in advance!

Bruno Santos

Arulraj A [Syncfusion]
Replied On March 12, 2019 12:01 PM UTC

Hi Bruno, 

Thanks for using Syncfusion product. 

You can achieve your required behavior by handling the QueryRowHeight and setting the height to zero for other rows except the needed ones. CellDrawn event need to be handled for the first row and draw the top border manually. Following code works for Day view. 

this.scheduleControl1.GetScheduleHost().QueryRowHeight += Form1_QueryRowHeight; 
this.scheduleControl1.GetScheduleHost().CellDrawn += Form1_CellDrawn; 
 
private void Form1_QueryRowHeight(object sender, Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs e) 
{ 
    if (e.Index < 18 || e.Index > 35) 
    { 
        e.Size = 0; 
        e.Handled = true; 
    } 
} 
 
private void Form1_CellDrawn(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellEventArgs e) 
{ 
    if (e.RowIndex == 18) 
    { 
        e.Style.Borders.Top = e.Style.Borders.Bottom; 
    } 
} 

 

Regards, 
Arulraj A 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon