开发者

Devexpress (10.2) GridControl isn't letting null value in column

I am using VB.net within Visual Studio 2008. I currently have GridControl where one of the columns fetches a real number from the database. Whenever I try to remove the value I get a red 'X' saying that the input string is not the right format even though I know it can display null because the row underneath fetched a null value for that column. See picture below.

Devexpress (10.2) GridControl isn't letting null value in column

I tried to solve this by setting the ColumnEdit of the column to a textedit and then setting it's allowNullInput to True. Still same pr开发者_StackOverflowoblem


Handle the ParseEditValue event of the grid column.

Imports DevExpress.XtraEditors.Repository

Public Class Form1
  Public WithEvents Edit As RepositoryItemTextEdit

  Public Sub Form1()
      Edit = GridView1.Columns("myColumn").ColumnEdit
  End Sub

  Private Sub Edit_ParseEditValue(sender As Object, e As DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs) Handles Edit.ParseEditValue
    If IsNothing(e.Value) Or (Not (e.Value Is Nothing) And String.IsNullOrEmpty(e.Value.ToString)) Then
        e.Value = DBNull.Value
    End If
  End Sub
End Class
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜