diff --git a/Demo/Models/Product.cs b/Demo/Models/Product.cs index ca4c3b8..a03e8c7 100644 --- a/Demo/Models/Product.cs +++ b/Demo/Models/Product.cs @@ -1,5 +1,6 @@ using Gridazor.Attributes; using Gridazor.Models; +using Gridazor.Statics; namespace Gridazor.Demo.Models; @@ -7,7 +8,7 @@ public class Product { [Editable(false)] [Hide] - [Required(false)] // auto generated + [Required(false)] public Guid Id { get; set; } = Guid.NewGuid(); [RowSelection] @@ -19,14 +20,13 @@ public class Product public DateOnly Date { get; set; } public DateTime DateTime { get; set; } - [CellEditor("agLargeTextCellEditor")] + [CellEditor(CellEditor.AgLargeTextCellEditor)] public string? Description { get; set; } [HeaderName("Category")] public int CatId { get; set; } [Required(true)] - [HeaderName("Image")] public FileInput? Image { get; set; } public double Price { get; set; } public int Quantity { get; set; } diff --git a/Demo/Resources/Views.Home.Index.ar.resx b/Demo/Resources/Views.Home.Index.ar.resx index d3563b5..05f0e87 100644 --- a/Demo/Resources/Views.Home.Index.ar.resx +++ b/Demo/Resources/Views.Home.Index.ar.resx @@ -120,4 +120,31 @@ التصنيف + + التاريخ + + + التاريخ والوقت + + + الوصف + + + الصورة + + + الاسم + + + السعر + + + النوعية + + + الكمية + + + مختارة + \ No newline at end of file diff --git a/Demo/Views/Home/Index.cshtml b/Demo/Views/Home/Index.cshtml index 4a1afed..a308ff7 100644 --- a/Demo/Views/Home/Index.cshtml +++ b/Demo/Views/Home/Index.cshtml @@ -2,6 +2,8 @@ @using Gridazor; @inject IViewLocalizer viewLocalizer; @using System.Globalization +@using Gridazor.Attributes +@using Gridazor.Settings @using Microsoft.AspNetCore.Mvc.Localization @{ string rtl = CultureInfo.CurrentCulture.TextInfo.IsRightToLeft.ToString().ToLower(); @@ -18,7 +20,10 @@
- @Html.GridEditorFor(x => x.Products, "myGrid", "ag-theme-quartz") + @Html.GridEditorFor(x => x.Products, "myGrid", "ag-theme-quartz", new Dictionary>() + { + { nameof(HeaderNameAttribute), (column) => viewLocalizer[column.HeaderName].Value }, + })