Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
Set date back to null
posted

I have a grid with a date that is nullable but when I set the date and then want to clear it, it will not let me set it back to null.   How can I do this?

I am using Entity Framework for my data

 

Parents
No Data
Reply
  • 10
    posted

    To enable a Infragistics grid date column to allow null value, try the following steps:

    1) In your business object class (a bindable data source that binds to the grid), create a property using the nullable date type:

        Public Property YourOptionalDate() As Nullable(Of Date)

    2) Then set these Infragistics Grid settings:

        Me.UltraGrid1.DisplayLayout.Bands(0).Columns("YourOptionalDate").Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Date
        Me.UltraGrid1.DisplayLayout.Bands(0).Columns("YourOptionalDate").ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.OnMouseEnter
        Me.UltraGrid1.DisplayLayout.Bands(0).Columns("YourOptionalDate").Nullable = Infragistics.Win.UltraWinGrid.Nullable.Nothing

    Then you will get a grid with a optional date column that correctly displays null. Hope it helps.
               
    Bernard Pang   

Children
No Data