diff --git a/Radzen.Blazor/RadzenDataGrid.razor.cs b/Radzen.Blazor/RadzenDataGrid.razor.cs index 9c988b36f7e..2bd1c84b8dd 100644 --- a/Radzen.Blazor/RadzenDataGrid.razor.cs +++ b/Radzen.Blazor/RadzenDataGrid.razor.cs @@ -34,6 +34,23 @@ namespace Radzen.Blazor #endif public partial class RadzenDataGrid : PagedDataBoundComponent { + /// + /// Returns the validity of the DataGrid. + /// + /// true if all validators in the DataGrid a valid; otherwise, false. + public bool IsValid + { + get + { + if (!editContexts.Any()) + { + return true; + } + + return editContexts.All(c => !c.Value.GetValidationMessages().Any()); + } + } + /// /// Gets or sets a value indicating whether this instance is virtualized. /// diff --git a/RadzenBlazorDemos/Pages/DataGridInLineEdit.razor b/RadzenBlazorDemos/Pages/DataGridInLineEdit.razor index ee5df58ca62..2fe3eb25c3b 100644 --- a/RadzenBlazorDemos/Pages/DataGridInLineEdit.razor +++ b/RadzenBlazorDemos/Pages/DataGridInLineEdit.razor @@ -6,7 +6,7 @@ @@ -14,13 +14,13 @@
Edit Mode:
+ Data="@(Enum.GetValues(typeof(DataGridEditMode)).Cast().Select(t => new { Text = $"{t}", Value = t }))" Size="ButtonSize.Small" + Disabled="@(editMode == DataGridEditMode.Multiple && ordersToInsert.Count() > 1)" />
+Data="@orders" TItem="Order" RowUpdate="@OnUpdateRow" RowCreate="@OnCreateRow" Sort="@Reset" Page="@Reset" Filter="@Reset" ColumnWidth="200px"> @@ -29,7 +29,7 @@ + InputAttributes="@(new Dictionary(){ { "aria-label", "Select customer" }})" /> @@ -39,7 +39,7 @@ + InputAttributes="@(new Dictionary(){ { "aria-label", "Select employee" }})">