Site Search:
Sign in | Join | Help
4Penny.net

Janus System

All things for all Janus products

GridEX with a CalendarCombo

Here is a clever way to use the standalone calendarcombo inside the grid.  This gets around the problem of editing the date and time as text.  This is based off of code i found on the Janus forums posted by "Stage Presence"

Private Sub grid_InitCustomEdit(ByVal sender As Object, ByVal e As Janus.Windows.GridEX.InitCustomEditEventArgs) Handles grid.InitCustomEdit
        Dim cc As New Janus.Windows.CalendarCombo.CalendarCombo
        cc.DateFormat = Janus.Windows.CalendarCombo.DateFormat.DateTime
        cc.BorderStyle = Janus.Windows.CalendarCombo.BorderStyle.None
        cc.VisualStyle = Janus.Windows.CalendarCombo.VisualStyle.Standard
        cc.ShowDropDown = True
        cc.ShowUpDown = False
        cc.UseCompatibleTextRendering = False
        cc.Value = CType(e.Value, DateTime)
        e.EditControl = cc
    End Sub

    Private Sub grid_EndCustomEdit(ByVal sender As Object, ByVal e As Janus.Windows.GridEX.EndCustomEditEventArgs) Handles grid.EndCustomEdit

        Dim cc As Janus.Windows.CalendarCombo.CalendarCombo = CType(e.EditControl, Janus.Windows.CalendarCombo.CalendarCombo)
        e.Value = cc.Value
    End Sub

 Then set the column edit type to custom.

Comments

No Comments

Leave a Comment

(required)  
(optional)
(required)  
Add