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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Show DetailsTemplate on row selection

Thread ID:

Created:

Updated:

Platform:

Replies:

118534 Mar 17,2015 03:39 PM UTC Mar 19,2015 09:45 AM UTC ASP.NET MVC 3
loading
Tags: Grid
Ian Hicks
Asked On March 17, 2015 03:39 PM UTC

Is there a way to automatically expand the DetailsTemplate on a grid when a row is selected rather than having the user click on the expand icon?

Thanks

Ajith R [Syncfusion]
Replied On March 18, 2015 06:23 AM UTC

Hi Ian,

Thanks for using Syncfusion products.

Query: Is there a way to automatically expand the DetailsTemplate on a grid when a row is selected rather than having the user click on the expand icon?

We suggest you to use RowSelected client side event and expand the details template by using expandCollapse function of Grid object. We can reselect the expanded details row to collapse it based on its e-detailrowcollapse class name. Please refer the below code snippet for further details.

@(Html.EJ().Grid<RowSelectedDetailsExpand.OrdersView>("DetailsGrid")

-------

-------

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

)

<script type="text/javascript">

function onRowSelected(args) {

if (args.row.find(".e-detailrowcollapse").length != 0)

this.expandCollapse(args.row.find(".e-detailrowcollapse"));

else

this.expandCollapse(args.row.find(".e-detailrowexpand"));

}

</script>

For your convenience we have created a simple sample and the same can be downloaded from the below link.

Sample Link: http://www.syncfusion.com/downloads/support/forum/118534/RowSelectedDetailsExpand115865716.zip

Please let us know if you have any concerns.

Regards,

Ajith R


Ian Hicks
Replied On March 18, 2015 10:04 AM UTC

Hi Ajith,
That's great, many thanks for your help.

Ajith R [Syncfusion]
Replied On March 19, 2015 09:45 AM UTC

Hi Ian,

Thanks for your update.

We are happy to hear that your requirement has been achieved in your end.

Please get back to us if you have any other concerns.

Regards,

Ajith 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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;