You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting column width of a List View, setting ListViewXml of a view doesn't seem to persist, but instead the list view is reset to default. By "reset" I mean that if I have added field to the view earlier, it is also removed, so the View resets to default fields too. This works when doing via PnP JS, but not when using PnP Core.
Steps to reproduce
// create list
var list = await destinationSiteContext.Web.Lists.AddAsync(listName, ListTemplateType.DocumentLibrary);
var defaultView = list.Views.First();
// get existing ListViewXml, add ColumnWidth definition for one field
var defaultViewXml = defaultView.ListViewXml
.Replace(
"</View>",
"<ColumnWidth><FieldRef Name=\"Modified\" width=\"370\" /></ColumnWidth></View>"
);
// save changes to view
defaultView.ListViewXml = defaultViewXml;
await defaultView.UpdateAsync();
Expected behavior
ListViewXml would contain the ColumnWidth definition and view in UI would also have wide Modified column.
Category
Describe the bug
When setting column width of a List View, setting ListViewXml of a view doesn't seem to persist, but instead the list view is reset to default. By "reset" I mean that if I have added field to the view earlier, it is also removed, so the View resets to default fields too. This works when doing via PnP JS, but not when using PnP Core.
Steps to reproduce
Expected behavior
ListViewXml would contain the ColumnWidth definition and view in UI would also have wide Modified column.
Environment details (development & target environment)
Additional context
Using PnPJs in SPFx web part it works:
The text was updated successfully, but these errors were encountered: