Custom Application

Mak Hattalli asked on September 3, 2015 14:56

Hi All,

I have added one custom module using UniGrid But when click on edit button its getting below error, any buddy can help from this.

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: System.IndexOutOfRangeException: There is no row at position 0.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

  1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:

[IndexOutOfRangeException: There is no row at position 0.] System.Data.RBTree`1.GetNodeByIndex(Int32 userIndex) +1524606 CMSModules_SFAEExhibition_Exhibition.BindExhibitionData(Int32 exid) +189 CMSModules_SFAEExhibition_Exhibition.Page_Load(Object sender, EventArgs e) +136 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51 System.EventHandler.Invoke(Object sender, EventArgs e) +0 System.Web.UI.Control.OnLoad(EventArgs e) +92 CMS.UIControls.CMSPage.OnLoad(EventArgs e) +64 System.Web.UI.Control.LoadRecursive() +54 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772

SO I am using this below code

<cms:UniGrid ID="CustomList" runat="server" ShowActionsMenu="true" > </cms:UniGrid>

Thanks Arjun

Recent Answers


Brenden Kehren answered on September 3, 2015 15:04

Did you follow the Kentico documentation on creating your module? Often times, you'll miss a simple step in the process that will cause errors like this.

0 votesVote for this answer Mark as a Correct answer

Mak Hattalli answered on September 3, 2015 15:41

Hi Brenden, Gone through the Kentico documentation and i am not missing any steps in that but still getting same issues, Please can you tell me where i am wrong. In Behind code : I am passing query string (this is one page) // Edit action if (DataHelper.GetNotEmpty(actionName, String.Empty) == "edit") { URLHelper.Redirect("Custom_test.aspx?exid=" + (string)actionArgument + "&CustomID=" + customID); }

In Another page i am getting those query string values :

int customID = QueryHelper.GetInteger("exid", 0); //if (!this.IsPostBack) //{ if (customID > 0) { DataTable dt = new DataTable(); dt = getSelectedArtistByExId(customID ); if (dt.Rows.Count > 0) { //Code Here } } Thanks, Arjun

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 3, 2015 17:59

So are you creating custom page templates/pages for each of your modules or are you using the portal engine? I should also ask what version you're using because module development is significantly different in v7 and v8.

0 votesVote for this answer Mark as a Correct answer

Mak Hattalli answered on September 3, 2015 18:32

Hi,

Yes, I am creating custom page templates/pages for each of your modules and we r using Kentico CMS 8.1 version

Thanks Arjun

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on September 3, 2015 22:58

A little off topic but any reason you aren't using the portal engine templates to create your module? You can create these within the Module and have it up and running without writing any code or creating any menu items, it's all configured vs. coded and easily upgraded.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.