Skip to main content
All docs
V25.1
  • ASPxClientGanttScaleCellPreparedEventArgs.startDate Property

    Gets the start date of the scale cell.

    Declaration

    startDate: Date

    Property Value

    Type Description
    Date

    The start date.

    Remarks

    Use the startDate property in the ScaleCellPrepared event to access the processed cell’s start date.

    The example below illustrates how to color the scale cells depending on the season:

    DevExpress ASP.NET Gantt - Customize Scale

    <dx:ASPxGantt runat="server" ID="Gantt" ClientInstanceName="clientGantt" >
        <SettingsTaskList>
            <Columns>
               <!-- ... -->
            </Columns>
        </SettingsTaskList>
        <ClientSideEvents 
            ScaleCellPrepared = "onGanttScaleCellPrepared"
        />
    </dx:ASPxGantt>
    
    function onGanttScaleCellPrepared(s, e) {
        var scaleElement = e.scaleElement;
        var color = "";
        var month = e.start.getMonth();
        if (month > 1 && month < 5) {
            color = "lightGreen";
        } else if (month > 4 && month < 8) {
            color = "green";
        } else if (month > 7 && month < 11) {
            color = "yellow";
        } else
            color = "white";
    
        scaleElement.style.backgroundColor = color;
    }
    
    See Also