GrapeCity MultiRow Windows Forms Documentation
ShowDropDownButton Property (DateTimePickerCell)
Example 


Gets or sets a value that indicates how to show the drop-down button when the cell is not in edit mode.
Syntax
<DefaultValueAttribute()>
<SRCategoryAttribute("Appearance")>
<SRDescriptionAttribute("Indicates how to show the DropDown button when the cell is not in edit mode.")>
Public Property ShowDropDownButton As CellButtonVisibility
Dim instance As DateTimePickerCell
Dim value As CellButtonVisibility
 
instance.ShowDropDownButton = value
 
value = instance.ShowDropDownButton
[DefaultValue()]
[SRCategory("Appearance")]
[SRDescription("Indicates how to show the DropDown button when the cell is not in edit mode.")]
public CellButtonVisibility ShowDropDownButton {get; set;}

Property Value

One of the CellButtonVisibility values. The default is CellButtonVisibility.ShowAlways.
Exceptions
ExceptionDescription
System.ComponentModel.InvalidEnumArgumentExceptionThe specified value is not one of the CellButtonVisibility values.
Remarks

If you want the DateTimePickerCell to show a drop-down button when the cell is the current cell, set this property's value to CellButtonVisibility.ShowForCurrentCell.

The ShowDropDownButton property affects the appearance of the cell when it is not in edit mode, and regardless of whether it is read-only. When the cell is in edit mode, it always looks like a System.Windows.Forms.DateTimePicker control.

Note:
If the ShowUpDown property is set to true, the ShowDropDownButton property also affects the spin button.

Example
The following code example shows how to customize a date time picker cell's behavior or appearance. This code example is part of a larger example provided for the DateTimePickerCell class.
DateTimePickerCell CreateDateTimePickerCellHiddenDropDownButton()
        {
            DateTimePickerCell dateTimePickerCell1 = new DateTimePickerCell();

            dateTimePickerCell1.Value = DateTime.Now;

            dateTimePickerCell1.Size = new Size(120, 21);

            // Hide drop down button when not in edit mode.
            dateTimePickerCell1.ShowDropDownButton = CellButtonVisibility.NotShown;

            return dateTimePickerCell1;
        }
Private Function CreateDateTimePickerCellHiddenDropDownButton() As DateTimePickerCell
        Dim dateTimePickerCell1 As New DateTimePickerCell()

        dateTimePickerCell1.Value = DateTime.Now

        dateTimePickerCell1.Size = New Size(120, 21)

        ' Hide drop down button when not in edit mode.
        dateTimePickerCell1.ShowDropDownButton = CellButtonVisibility.NotShown

        Return dateTimePickerCell1
    End Function
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

DateTimePickerCell Class
DateTimePickerCell Members

 

 


Copyright © GrapeCity, inc. All rights reserved.