Skip to content

Commit 796e611

Browse files
csharpfritzCopilot
andcommitted
feat: implement 16 ListView CRUD events (FritzAndFriends#356)
Add missing Web Forms-parity properties to ListView EventArgs types: - ListViewInsertEventArgs: add Values (IOrderedDictionary) - ListViewUpdateEventArgs: add Keys, OldValues, NewValues (IOrderedDictionary) - ListViewDeleteEventArgs: add Keys, Values (IOrderedDictionary) - ListViewPagePropertiesChangingEventArgs: add TotalRowCount All 16 events were already wired with [Parameter] EventCallbacks and HandleCommand routing. This commit completes EventArgs property parity with System.Web.UI.WebControls originals. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 999e484 commit 796e611

4 files changed

Lines changed: 44 additions & 0 deletions

File tree

src/BlazorWebFormsComponents/ListViewDeleteEventArgs.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Specialized;
23

34
namespace BlazorWebFormsComponents
45
{
@@ -10,6 +11,8 @@ public class ListViewDeleteEventArgs : EventArgs
1011
public ListViewDeleteEventArgs(int itemIndex)
1112
{
1213
ItemIndex = itemIndex;
14+
Keys = new OrderedDictionary();
15+
Values = new OrderedDictionary();
1316
}
1417

1518
/// <summary>
@@ -21,5 +24,15 @@ public ListViewDeleteEventArgs(int itemIndex)
2124
/// Gets or sets a value indicating whether the event should be cancelled.
2225
/// </summary>
2326
public bool Cancel { get; set; }
27+
28+
/// <summary>
29+
/// Gets a dictionary of field name/value pairs that represent the key of the item to delete.
30+
/// </summary>
31+
public IOrderedDictionary Keys { get; }
32+
33+
/// <summary>
34+
/// Gets a dictionary of the non-key field name/value pairs in the item to delete.
35+
/// </summary>
36+
public IOrderedDictionary Values { get; }
2437
}
2538
}

src/BlazorWebFormsComponents/ListViewInsertEventArgs.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Specialized;
23

34
namespace BlazorWebFormsComponents
45
{
@@ -9,6 +10,7 @@ public class ListViewInsertEventArgs : EventArgs
910
{
1011
public ListViewInsertEventArgs()
1112
{
13+
Values = new OrderedDictionary();
1214
}
1315

1416
/// <summary>
@@ -20,5 +22,10 @@ public ListViewInsertEventArgs()
2022
/// Gets the item to be inserted.
2123
/// </summary>
2224
public object Item { get; set; }
25+
26+
/// <summary>
27+
/// Gets the values for the record to insert.
28+
/// </summary>
29+
public IOrderedDictionary Values { get; }
2330
}
2431
}

src/BlazorWebFormsComponents/ListViewPagePropertiesChangingEventArgs.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,10 @@ public ListViewPagePropertiesChangingEventArgs(int startRowIndex, int maximumRow
2222
/// Gets the maximum number of items to display on each page.
2323
/// </summary>
2424
public int MaximumRows { get; }
25+
26+
/// <summary>
27+
/// Gets or sets the total number of rows in the underlying data source.
28+
/// </summary>
29+
public int TotalRowCount { get; set; }
2530
}
2631
}

src/BlazorWebFormsComponents/ListViewUpdateEventArgs.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Specialized;
23

34
namespace BlazorWebFormsComponents
45
{
@@ -10,6 +11,9 @@ public class ListViewUpdateEventArgs : EventArgs
1011
public ListViewUpdateEventArgs(int itemIndex)
1112
{
1213
ItemIndex = itemIndex;
14+
Keys = new OrderedDictionary();
15+
OldValues = new OrderedDictionary();
16+
NewValues = new OrderedDictionary();
1317
}
1418

1519
/// <summary>
@@ -21,5 +25,20 @@ public ListViewUpdateEventArgs(int itemIndex)
2125
/// Gets or sets a value indicating whether the event should be cancelled.
2226
/// </summary>
2327
public bool Cancel { get; set; }
28+
29+
/// <summary>
30+
/// Gets a dictionary of field name/value pairs that represent the key of the item to update.
31+
/// </summary>
32+
public IOrderedDictionary Keys { get; }
33+
34+
/// <summary>
35+
/// Gets a dictionary that contains the original values of the item to update.
36+
/// </summary>
37+
public IOrderedDictionary OldValues { get; }
38+
39+
/// <summary>
40+
/// Gets a dictionary that contains the revised values of the item to update.
41+
/// </summary>
42+
public IOrderedDictionary NewValues { get; }
2443
}
2544
}

0 commit comments

Comments
 (0)