This is a migrated thread and some comments may be shown as answers.

GridviewDateTimeColumn Remove or disable Clear button from calendar

1 Answer 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sakthi
Top achievements
Rank 1
Sakthi asked on 08 Jan 2014, 03:26 AM
Hi 
 I am using gridviewdatetime column in my gridview (winforms). When user click the cell The calendar popup to select the date. The calendar control have two default button 1. Clear 2. Today. I want to diable or remove the Clear button from calendar popup.
Please reply (Urgent)

1 Answer, 1 is accepted

Sort by
0
Karthik
Top achievements
Rank 1
Iron
answered on 15 Apr 2024, 01:44 PM

Though the threat is 10 years old, it might help someone.

  1. Handle the cell editor initialized event of the grid.
  2. Access the active editor and set the appropriate property. E.g.
Private Sub OnGridCellEditorInitialized(sender As Object, e As GridViewCellEventArgs)
        If e.ColumnIndex = ListColumns.Date Then
            Dim editor As RadDateTimeEditor = CType(Me.grdList.ActiveEditor, RadDateTimeEditor)
            Dim editorElement As RadDateTimePickerElement = CType(editor.EditorElement, RadDateTimePickerElement)
            editorElement.Calendar.ClearButton.Visibility = Telerik.WinControls.ElementVisibility.Collapsed
        End If
End Sub
NOTE: ListColumns is an enum having list of columns.
Tags
GridView
Asked by
Sakthi
Top achievements
Rank 1
Answers by
Karthik
Top achievements
Rank 1
Iron
Share this question
or