Back to Devexpress

TdxRangeControlCustomDateTimeClientProperties.PrimaryScale Property

vcl-dxrangecontrol-dot-tdxrangecontrolcustomdatetimeclientproperties-966725b9.md

latest4.2 KB
Original Source

TdxRangeControlCustomDateTimeClientProperties.PrimaryScale Property

Specifies the primary scale on the range control‘s ruler provided by the date/time header client.

Declaration

delphi
property PrimaryScale: TdxRangeControlDateTimeScale read; write;

Property Value

Type
TdxRangeControlDateTimeScale

Remarks

The primary scale determines the measurement unit corresponding to the minimum date/time range that can be selected by using a range control integrated with the date/time header client. To change the current primary scale on the range control’s ruler, you can assign one of the scales supported by the client to the PrimaryScale property:

ValueScale’s Measurement UnitSynchronized with the Property Value
Scales.DayrcduDayScales.Day.Active
Scales.HourrcduHourScales.Hour.Active
Scales.MinutercduMinuteScales.Minute.Active
Scales.MonthrcduMonthScales.Month.Active
Scales.QuarterrcduQuarterScales.Quarter.Active
Scales.WeekrcduWeekScales.Week.Active
Scales.YearrcduYearScales.Year.Active

The following code example sets the minimal selectable date/time range to one hour. Note that the primary scale does not become visible automatically.

delphi
var
  ADateTimeHeaderProperties: TdxRangeControlDateTimeHeaderClientProperties;
//...
  ADateTimeHeaderProperties := dxRangeControl1.ClientProperties as TdxRangeControlDateTimeHeaderClientProperties;
  ADateTimeHeaderProperties.PrimaryScale := ADateTimeHeaderProperties.Scales.Hour;
  ADateTimeHeaderProperties.PrimaryScale.Visible := True; // Display the new primary scale on the range control's ruler if the "Hour" scale is not already visible
cpp
TdxRangeControlDateTimeHeaderClientProperties *ADateTimeHeaderProperties;
//...
  ADateTimeHeaderProperties = dynamic_cast<TdxRangeControlDateTimeHeaderClientProperties*>(dxRangeControl1->ClientProperties);
  ADateTimeHeaderProperties->PrimaryScale = ADateTimeHeaderProperties->Scales->Hour;
  ADateTimeHeaderProperties->PrimaryScale->Visible = true; // Display the new primary scale on the range control's ruler if the "Hour" scale is not already visible

Alternatively, you can set the corresponding synchronized property to True.

Note

To identify the minimum range that can be selected by using the range control integrated with the date/time header client, use the PrimaryScale.ScaleUnit property

See Also

TdxRangeControlDateTimeClientProperties.Scale

TdxRangeControlCustomDateTimeClientProperties Class

TdxRangeControlCustomDateTimeClientProperties Members

dxRangeControl Unit