Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Empty Grid results in error " Cannot find table 0." View modes: 
User avatar
Member
Member
celeste - 11/24/2011 8:34:40 PM
   
Empty Grid results in error " Cannot find table 0."
I'm using the Grid web part on one of my pages to show documents from a specific location owned by the current user. This works well when the user actually has documents. However, it results in the below error when there are 0 results. I'm using the default properties of the Grid web part with the following changes:
Path = /dir1/dir2/%
document types = mine.myDocType1
WHERE condition = NodeOwner = {%CurrentUser.UserID%}
selected item transformation = mine.myDocType1.Default

If I remove the WHERE condition, every user can see every document. If I include the WHERE condition, then users who own documents see only their own documents; users without documents receive the following error:

Line 911: protected void Page_Load(object sender, EventArgs e)
Line 912: {
Line 913: gridElem.ReloadData(true);
Line 914: }
Line 915:

Source File: C:\inetpub\wwwroot\KenticoCMS\CMSWebParts\Viewers\Documents\cmsdatagrid.ascx.cs Line: 913

Stack Trace:

[IndexOutOfRangeException: Cannot find table 0.]
System.Data.DataTableCollection.get_Item(Int32 index) +6311442
CMS.ExtendedControls.UIDataGrid.set_DataSource(Object value) +118
CMS.Controls.BasicDataGrid.DataBind() +616
CMS.Controls.CMSDataGrid.LoadData(Boolean forceReload) +330
CMSWebParts_Viewers_Documents_cmsdatagrid.Page_Load(Object sender, EventArgs e) in C:\inetpub\wwwroot\KenticoCMS\CMSWebParts\Viewers\Documents\cmsdatagrid.ascx.cs:913
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
CMS.ExtendedControls.AbstractUserControl.OnLoad(EventArgs e) +130
CMS.PortalControls.CMSAbstractWebPart.OnLoad(EventArgs e) +195

This is v6 hotfix 6, using the portal engine.

Anyone else having this issue?

User avatar
Member
Member
kentico_michal - 11/25/2011 4:38:14 AM
   
RE:Empty Grid results in error " Cannot find table 0."
Hello,

Regrettably, this seems to be a bug in the current version of Kentico CMS. Thank you for letting us know about this issue. We will try to fix it in the next hotfix 6.0.7. I am sorry for this inconvenience.

Best regards,
Michal Legen

User avatar
Member
Member
Snarrak - 1/20/2012 6:02:23 AM
   
RE:Empty Grid results in error " Cannot find table 0."
Thanks, this worked for me!