ASPxClientGanttScaleCellPreparedEventArgs.endDate Property
Gets the end date of the scale cell.
Declaration
endDate: Date
Property Value
Type | Description |
---|---|
Date | The end date. |
Remarks
Use the endDate property in the ScaleCellPrepared event to access the processed cell’s end date.
The example below illustrates how to color the scale cells depending on the season:
<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.end.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