Method ‘RenderAsHtml’ is not supported on Microsoft.SharePoint.SPList for external lists.
Error: In a SharePoint list, for filtering a column, when you click on “Show Filter Choices” it throws below error-
“Sorry, something went wrong
The “XsltListViewWebPart” Web Part appears to be causing a problem. Method ‘RenderAsHtml’ is not supported on Microsoft.SharePoint.SPList for external lists.”
Resolution:
SharePoint list shows choices for the columns up to 500 items. After this limit, we see “Show Filter Choices” option to display all the choices available for the column.
Non External lists are working fine for “Show Filter Choices” option but for External lists, it throws an exception because there is no method implemented for this feature.
The code which is generating error:
public string RenderAsHtml(SPQuery query)
{
if (this.HasExternalDataSource)
{
SPExternalList.ThrowNotSupportedExceptionForMethod(“RenderAsHtml”, base.GetType());
}
return this.RenderAsHtml(query, null);
}
These list Items need to be fetched explicitly from the data source which will override the OOTB “Show Filter Choices“. So for external lists, you will need to create a new method which will be used to implement “Show Filter Choices”.
1,435 total views, 1 views today
0 Comments