Skip to content

Commit 1b00a39

Browse files
committed
Added support for setting multiple selected values
1 parent 0272076 commit 1b00a39

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

Build/CommonAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
//
1616
// You can specify all the values or you can default the Revision and Build Numbers
1717
// by using the '*' as shown below:
18-
[assembly: AssemblyVersion("1.0.55.0")]
19-
[assembly: AssemblyFileVersion("1.0.55.0")]
18+
[assembly: AssemblyVersion("1.0.57.0")]
19+
[assembly: AssemblyFileVersion("1.0.57.0")]

Griddly.Mvc/GriddlyExtensions.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,23 @@ public static void SetGriddlyDefault<T>(this Controller controller, ref T parame
108108
controller.ViewData["_griddlyDefault_" + field] = value;
109109
}
110110

111+
public static void SetGriddlyDefault<T>(this Controller controller, ref T[] parameter, string field, IEnumerable<T> value)
112+
{
113+
if (controller.ControllerContext.IsChildAction)
114+
parameter = value.ToArray();
115+
116+
controller.ViewData["_griddlyDefault_" + field] = value;
117+
}
118+
119+
public static void SetGriddlyDefault<T>(this Controller controller, ref T?[] parameter, string field, IEnumerable<T> value)
120+
where T: struct
121+
{
122+
if (controller.ControllerContext.IsChildAction)
123+
parameter = value.Cast<T?>().ToArray();
124+
125+
controller.ViewData["_griddlyDefault_" + field] = value;
126+
}
127+
111128
public static object GetGriddlyDefault(this WebViewPage page, string field)
112129
{
113130
return page.ViewData["_griddlyDefault_" + field];

0 commit comments

Comments
 (0)