TreeView Exception Error - Long path name?

Topics: User Forum
Oct 28, 2009 at 8:47 PM

I am using TreeView with a document library that was working for a while, but as I began adding a group of folders and files, I get the error:

Error : RenderTreeView.

System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at Stramit.WP.DocumentLibraryBrowser.RenderTreeView(SPFolder pfolder, MyTreeViewItem pItemParent)

Shortly before I got the error, I was getting messages from Sharepoint while uploading new files and folders that the total length of the folder/file path was too long.  This is understandable as the folders are 5 or 6 levels deep and the files have some long names.  I overcame the problem by shortening filenames and foldernames.

Due to the error above saying "Length cannot be less than zero", is it possible the error is caused by a path that is legal according to Sharepoint but messing up the webpart?