diff --git a/DbFirst.BlazorWebApp/Components/App.razor b/DbFirst.BlazorWebApp/Components/App.razor
index 98a93a3..f6e8697 100644
--- a/DbFirst.BlazorWebApp/Components/App.razor
+++ b/DbFirst.BlazorWebApp/Components/App.razor
@@ -18,6 +18,7 @@
+
diff --git a/DbFirst.BlazorWebApp/Components/BandGridBase.cs b/DbFirst.BlazorWebApp/Components/BandGridBase.cs
index 29bbec7..47766cd 100644
--- a/DbFirst.BlazorWebApp/Components/BandGridBase.cs
+++ b/DbFirst.BlazorWebApp/Components/BandGridBase.cs
@@ -103,6 +103,8 @@ public abstract class BandGridBase : ComponentBase
// --- Band-Methoden ---
protected bool CanSaveBandLayout => !string.IsNullOrWhiteSpace(layoutUser);
+ protected virtual bool ShowCommandColumn => true;
+
protected void AddBand()
{
bandLayout.Bands.Add(new BandDefinition { Id = Guid.NewGuid().ToString("N"), Caption = "Band" });
@@ -172,9 +174,12 @@ public abstract class BandGridBase : ComponentBase
protected RenderFragment RenderColumns() => builder =>
{
var seq = 0;
- builder.OpenComponent(seq++);
- builder.AddAttribute(seq++, "Width", "120px");
- builder.CloseComponent();
+ if (ShowCommandColumn)
+ {
+ builder.OpenComponent(seq++);
+ builder.AddAttribute(seq++, "Width", "120px");
+ builder.CloseComponent();
+ }
var grouped = bandLayout.Bands.SelectMany(b => b.Columns).ToHashSet(StringComparer.OrdinalIgnoreCase);
foreach (var column in ColumnDefinitions.Where(c => !grouped.Contains(c.FieldName)))
@@ -184,8 +189,6 @@ public abstract class BandGridBase : ComponentBase
{
if (band.Columns.Count == 0) continue;
builder.OpenComponent(seq++);
- builder.AddAttribute(seq++, "Width", "120px");
- builder.AddAttribute(seq++, "NewButtonVisible", false); // falls noch nicht vorhanden
builder.AddAttribute(seq++, "Caption", band.Caption);
builder.AddAttribute(seq++, "Columns", (RenderFragment)(bandBuilder =>
{
diff --git a/DbFirst.BlazorWebApp/Components/CatalogsGrid.razor b/DbFirst.BlazorWebApp/Components/CatalogsGrid.razor
index 4647b7f..ca33b29 100644
--- a/DbFirst.BlazorWebApp/Components/CatalogsGrid.razor
+++ b/DbFirst.BlazorWebApp/Components/CatalogsGrid.razor
@@ -59,9 +59,34 @@ else
DataItemDeleting="OnDataItemDeleting"
FocusedRowEnabled="true"
@bind-FocusedRowKey="focusedRowKey"
+ RowClick="@(args => _focusedVisibleIndex = args.VisibleIndex)"
@ref="gridRef">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
"CatalogsGrid";
+ protected override bool ShowCommandColumn => false;
protected override List ColumnDefinitions { get; } = new()
{
@@ -353,6 +379,17 @@ else
public string Text { get; set; } = string.Empty;
}
+ private int _focusedVisibleIndex;
+
+ private async Task EditFocusedRow()
+ => await gridRef!.StartEditRowAsync(_focusedVisibleIndex);
+
+ private Task DeleteFocusedRow()
+ {
+ gridRef!.ShowRowDeleteConfirmation(_focusedVisibleIndex);
+ return Task.CompletedTask;
+ }
+
private async Task SaveLayoutWithFeedbackAsync()
{
try
diff --git a/DbFirst.BlazorWebApp/Components/MassDataGrid.razor b/DbFirst.BlazorWebApp/Components/MassDataGrid.razor
index 954ac38..e55ffeb 100644
--- a/DbFirst.BlazorWebApp/Components/MassDataGrid.razor
+++ b/DbFirst.BlazorWebApp/Components/MassDataGrid.razor
@@ -72,9 +72,34 @@ else
DataItemDeleting="OnDataItemDeleting"
FocusedRowEnabled="true"
@bind-FocusedRowKey="focusedRowKey"
+ RowClick="@(args => _focusedVisibleIndex = args.VisibleIndex)"
@ref="gridRef">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
"MassDataGrid";
+ protected override bool ShowCommandColumn => false;
protected override List ColumnDefinitions { get; } = new()
{
@@ -366,6 +392,17 @@ else
public string Text { get; set; } = string.Empty;
}
+ private int _focusedVisibleIndex;
+
+ private async Task EditFocusedRow()
+ => await gridRef!.StartEditRowAsync(_focusedVisibleIndex);
+
+ private Task DeleteFocusedRow()
+ {
+ gridRef!.ShowRowDeleteConfirmation(_focusedVisibleIndex);
+ return Task.CompletedTask;
+ }
+
private async Task SaveLayoutWithFeedbackAsync()
{
try