-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved/fixed some of the logic for rendering the grid
- Loading branch information
Showing
6 changed files
with
82 additions
and
12 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
src/Skybrud.Umbraco.GridData/Extensions/TypedGridExtensionMethods.Controls.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Web; | ||
using System.Web.Mvc; | ||
|
||
namespace Skybrud.Umbraco.GridData.Extensions { | ||
|
||
/// <summary> | ||
/// Class holding various extension methods for using the typed Grid. | ||
/// </summary> | ||
public static partial class TypedGridExtensionMethods { | ||
|
||
/// <summary> | ||
/// Gets the HTML of the specified <paramref name="control"/>. | ||
/// </summary> | ||
/// <param name="helper">The instance of <see cref="HtmlHelper"/> used for rendering the control.</param> | ||
/// <param name="control">The control to be rendered.</param> | ||
/// <returns>An instance of <see cref="HtmlString"/>.</returns> | ||
public static HtmlString RenderGridControl(this HtmlHelper helper, GridControl control) { | ||
if (helper == null || control == null) return new HtmlString(""); | ||
return control.GetHtml(helper); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the HTML of the specified <paramref name="control"/>. | ||
/// </summary> | ||
/// <param name="helper">The instance of <see cref="HtmlHelper"/> used for rendering the control.</param> | ||
/// <param name="control">The control to be rendered.</param> | ||
/// <param name="partial">The partial view to be used for the rendering.</param> | ||
/// <returns>An instance of <see cref="HtmlString"/>.</returns> | ||
public static HtmlString RenderGridControl(this HtmlHelper helper, GridControl control, string partial) { | ||
if (helper == null || control == null) return new HtmlString(""); | ||
return control.GetHtml(helper, partial); | ||
} | ||
|
||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
src/Skybrud.Umbraco.GridData/Extensions/TypedGridExtensionMethods.Rows.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Web; | ||
using System.Web.Mvc; | ||
|
||
namespace Skybrud.Umbraco.GridData.Extensions { | ||
|
||
/// <summary> | ||
/// Class holding various extension methods for using the typed Grid. | ||
/// </summary> | ||
public static partial class TypedGridExtensionMethods { | ||
|
||
/// <summary> | ||
/// Gets the HTML of the specified <paramref name="row"/>. | ||
/// </summary> | ||
/// <param name="helper">The instance of <see cref="HtmlHelper"/> used for rendering the row.</param> | ||
/// <param name="row">The row to be rendered.</param> | ||
/// <returns>An instance of <see cref="HtmlString"/>.</returns> | ||
public static HtmlString RenderGridRow(this HtmlHelper helper, GridRow row) { | ||
if (helper == null || row == null) return new HtmlString(""); | ||
return row.GetHtml(helper); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the HTML of the specified <paramref name="row"/>. | ||
/// </summary> | ||
/// <param name="helper">The instance of <see cref="HtmlHelper"/> used for rendering the row.</param> | ||
/// <param name="row">The row to be rendered.</param> | ||
/// <param name="partial">The partial view to be used for the rendering.</param> | ||
/// <returns>An instance of <see cref="HtmlString"/>.</returns> | ||
public static HtmlString RenderGridRow(this HtmlHelper helper, GridRow row, string partial) { | ||
if (helper == null || row == null) return new HtmlString(""); | ||
return row.GetHtml(helper, partial); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters