Re: GridView as a custom content part

Topics: Administration, Customizing Orchard, Writing modules
Apr 16, 2015 at 2:45 PM
Edited Apr 16, 2015 at 3:11 PM
Hello Orchard Team,

I want to create custom content part, which need to execute query and return resultset in a grid format(with paging, sorting and search).

Anybody has experience or any URL to be shared, that helps to finish it off.

Thanks in Advance.


For this,
  1. Created Module, named GridView.
  2. Created API Controller/Get method and returned result as List type.{this has the query to return the result}
  3. Calling this in GridView.cshtml page by ajax method call, and binding the response/result in a table.
  4. Enabled this module
    5.Created content definition with content parts - Title, AutoRoute, and this ContentPart (GridView).
    6.Opened this content new content type, and entered Title, and hit "Save" button,
    This is the error,

Server Error in '/' Application.

null id in Orchard.ContentManagement.Records.ContentTypeRecord entry (don't flush the Session after an exception occurs)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: NHibernate.AssertionFailure: null id in Orchard.ContentManagement.Records.ContentTypeRecord entry (don't flush the Session after an exception occurs)
Source Error:
Line 46:
Line 47: public IEnumerable<string> GetFeaturesThatNeedUpdate() {
Line 48: var currentVersions = _dataMigrationRepository.Table.ToDictionary(r => r.DataMigrationClass);
Line 49:
Line 50: var outOfDateMigrations = _dataMigrations.Where(dataMigration => {


Any help would be appreciated.