0

I have created a custom solution and used listviewwebpart to display the data. It works fine if I have only one webpart added on a page but as soon as I add another webpart I get RENDER FAILED error when I expand the row for webpart. Below is my code for the same. I am taking weburl, list name and view name as an input from the user.

ListViewWebPart lvwp = new ListViewWebPart();
lvwp.Visible = true;
lvwp.EnableViewState = true;

SPList list = web.Lists[ListName.ToString()];                                

lvwp.ListName = list.ID.ToString("B").Trim().ToUpperInvariant();
lvwp.WebId = list.ParentWeb.ID;
lvwp.ListId = list.ID;

if (!string.IsNullOrEmpty(ViewName))
{
SPView defaultView = list.Views[ViewName];
lvwp.ViewId = Int32.Parse(defaultView.BaseViewID);
lvwp.ViewGuid = defaultView.ID.ToString("B").Trim().ToUpperInvariant();
}

lvwp.ChromeState = System.Web.UI.WebControls.WebParts.PartChromeState.Normal;
lvwp.ChromeType = System.Web.UI.WebControls.WebParts.PartChromeType.None;
lvwp.HelpMode = WebPartHelpMode.Modeless;

this.Controls.Add(lvwp);

Do anyone have any idea why is it happening. Any help is highly appreciated.

Thanks

1

I’ve had similar problems which were solved by changing from ListViewWebPart to XsltListViewWebPart.

It’s often related with lookup fields in the view, so also check by removing lookup fields, user fields etc. from the view.

Try using XsltListViewWebPart instead of ListViewWebPart, and make sure the web part is really XsltListViewWebPart. You can check by adding "?contents=1" in the end of the page’s Url or with SharePoint Designer.

Check here one of my ‘RENDER FAILED’ problems I've had and its resolution. It may have something in common with your problem.

  • XSLTListViewWebPart doesn't solve my problem. I checked that earlier it is not render anything in xsltlistveiwwebpart. So only I started using ListViewWebPart. And the problem is coming when I add another webpart on the page. Before that it's working as expected. – Ankit Jan 6 '14 at 10:40
  • Then try by using another view and by removing fields from the view one by one and test the result. I can't see any problem in your code. – Naim Murati Jan 6 '14 at 10:53
  • I have managed to get the data after assigning id to listviewwebpart after initializing. lvwp.ID=this.ID. But after that started getting another error. First time the data displays correctly but after that it stuck at Loading... It doesn't load the data. – Ankit Jan 7 '14 at 7:32
0

I've seen this occur in regular views as well (i.e. not custom web pages). It appears to be an issue with bad data in the list itself. Try removing fields from the view one by one until you don't get the error anymore.

Unfortunately as of now I don't know of a good way to retrieve the data from the column in question if it does turn out to be an issue with the list itself. If the column doesn't contain any necessary data you could, of course, delete it altogether.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.