Declined
Last Updated: 12 Dec 2015 11:58 by ADMIN
ADMIN
Anton
Created on: 30 Oct 2012 06:43
Category: GridView
Type: Bug Report
1
FIX. RadGridView - can enter null to GridView that is bound to DataTable that doesn't accept null values
How to handle this case:

Subscribe to the CellValidating event and add logic for validation. For example:

If e.Value Is Nothing Then
    e.Cancel = True
End If

Additionally you can handle the DataError event to handle cases where users are trying to submit invalid data through the grid to its data source.

Finally, you can subscribe to the ContextMenuOpening event where to hide the "Clear value" item from context menu with following code snippet:

For i As Integer = 0 To e.ContextMenu.Items.Count - 1
    If e.ContextMenu.Items(i).Text = "Clear Value" Then
        e.ContextMenu.Items(i).Visibility = Telerik.WinControls.ElementVisibility.Collapsed
    End If
Next
1 comment
ADMIN
Ivan Petrov
Posted on: 17 Nov 2015 14:28
Data validation should be handled by the developer. RadGridView does not know to what source of data it is bound to and does not have any knowledge of the DataTable specifics.