We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

RenderAction within DetailsTemplate

Thread ID:

Created:

Updated:

Platform:

Replies:

118706 Apr 1,2015 11:07 AM Apr 2,2015 09:54 AM ASP.NET MVC 1
loading
Tags: Grid
Ian Hicks
Asked On April 1, 2015 11:07 AM

Hi,
Is it possible to use Html.RenderAction or Html.RenderPartial within a DetailsTemplate such as:

<script id="tabGridContents" type="text/x-jsrender">
<div>
    @{Html.RenderAction("GetEmployeeDetails", new { id = "{{:EmployeeId}}" });}
</div>
</script>

@(Html.EJ().Grid<EmployeeView>("DetailTemplate") .Datasource((IEnumerable<object>)ViewBag.datasource) .Columns(col =>
col.Field("EmployeeID").HeaderText("Employee ID").IsPrimaryKey(true).TextAlign(TextAlign.Right).Width(75).Add();
col.Field("FirstName").HeaderText("First Name").Width(100).Add();
col.Field("Title").Width(120).Add();
col.Field("City").Width(100).Add();
col.Field("Country").Width(100).Add();
})
.DetailsTemplate("#tabGridContents")
)


Sellappandi Ramu [Syncfusion]
Replied On April 2, 2015 09:54 AM

Hi Lan Hicks,

Thanks for using Syncfusion products.

Based on your requirement we have created a sample by using Html.RenderPartial. The sample can be downloaded from following location.

Sample Link: http://www.syncfusion.com/downloads/support/forum/118706/DetailsTemplate1914582495.zip

Please refer the following code snippet.

[Grid.cshtml]

@(Html.EJ().Grid<DetailsTemplate.OrdersView>("FlatGrid")

.Datasource((IEnumerable<object>)ViewBag.datasource)

.AllowScrolling()

.AllowPaging() /*Paging Enabled*/

.Columns(col =>

{

})

.DetailsTemplate("#detailGridContents")

.ClientSideEvents(eve => { eve.DetailsDataBound("detailGridData"); })

)

<script src="~/Scripts/jsondata.js"></script>

<script id="detailGridContents" type="text/x-jsrender">

@{Html.RenderPartial("DetailTemplate");}

</script

[DetailTemplate.cshtml]

<div id="gridTab{{:OrderID}}">

<div id="detailGrid">

</div>

</div>

Please try the above sample and let us know if it helps. If we misunderstood your requirements, please provide us clear information. The information provided would be more helpful for us to analyze the issue and provide you the response as early as possible.

Regards,

Sellappandi R


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;