Declined
Last Updated: 26 Feb 2018 17:39 by Mike
ADMIN
Dimitar
Created on: 19 Feb 2018 07:30
Category: GridView
Type: Bug Report
0
FIX. RadGridView - exception when the NullValue of a column is set to empty string.
To reproduce:
Public Class RadForm1
    Public RadGridView1 As RadGridView

    Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles Me.Load
        CreateGrid()
        FormatGrid()
        SetDataSource()
    End Sub

    Private Sub CreateGrid()
        Try
            RadGridView1 = New RadGridView
            Me.Controls.Add(RadGridView1)
        Catch ex As Exception
            MessageBox.Show(Me, ex.Message)
        End Try
    End Sub
    Private Sub FormatGrid()

        Dim col As GridViewTextBoxColumn
        With RadGridView1
            col = New GridViewTextBoxColumn
            With col
                .FieldName = "FieldID"
                'NOTE: Comment out NullValue = "" to prevent the unhandled exception
                .NullValue = ""
            End With
            .Columns.Add(col)
        End With
    End Sub
    Private Sub SetDataSource()
        Dim table As DataTable = Nothing
        Dim row As DataRow = Nothing
        table = New DataTable("GridList")
        table.Columns.Add("FieldID", GetType(System.Guid))
        row = table.NewRow
        row("FieldID") = Guid.Empty
        table.Rows.Add(row)
        RadGridView1.DataSource = table
    End Sub
End Class

Workaround:
Comment this line 
NullValue = ""
4 comments
Mike
Posted on: 26 Feb 2018 17:39
deleted by miken
ADMIN
Peter
Posted on: 26 Feb 2018 09:41
Thank you for writing back. 
We should not handle this situation in our code and it should be handled in the developer code because through the NullValue property you specify a valid value for this column. We raise the exception https://www.screencast.com/t/nEqy0x30V2 because column's parser cannot parse an empty string as valid GUID. 
Mike
Posted on: 23 Feb 2018 18:47
deleted by miken
ADMIN
Peter
Posted on: 21 Feb 2018 14:05
Is not an issue: Тhe GUID type cannot accept an empty string as valid value. 
The valid value is Guid.Empty e.g. "0000-000-0000-00000" so this line  .NullValue = "" should be  .NullValue = Guid.Empty. 
The case with empty cells in GUID column should be handled via CellFormatting event https://docs.telerik.com/devtools/winforms/gridview/cells/formatting-cells