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
1165
Row Template Editor and Custom Biz Objects
posted

This is an urgent issue, so a quick response would be appreciated.

We are attempting to bind custom biz objects to the ultra grid and also to use the row template editor.

When binding objects with DateTime or numeric properties, we need users to be able to enter an 'empty string' in some cases, but the row template editor is having a problem with this.  For example, if we use the following property and then try to remove an existing date, the template editor will not respond to the OK or Cancel buttons.  If we use a datatable with the same data type, everything works fine:

 

 

 

 

 

 

 

 

 

 

 

 

Public 

 

Property Col2() As System.DateTime

 

 

Get

 

 

 

 

If _Col2 = DateTime.MinValue Then

 

 

   Return ""

 

 

 

Else

 

 

 

 

   Return _Col2.Date.ToString

 

 

End If

 

 

 

' Return _Col2

 

 

 

 

 

 

End Get

 

 

Set(ByVal value As System.DateTime)

   _Col2 = value

 

 

End Set

 

 

End Property

 

 

Parents
  • 37774
    Suggested Answer
    posted

    The RowEditTemplate uses the same editor, and constraints, that the cell would use when directly editing it, so I don't think this issue is specific to the template.  Regardless, it sounds like the DataSource does not like the null value that is being passed from the grid when trying to update the cell.  Try setting the Nullable property of the column to Nothing.

    -Matt

Reply Children