# Using UButton::SetStyle(OtherStyle) updates detail panel but doesn't serialize

**URL:** <https://forums.unrealengine.com/t/using-ubutton-setstyle-otherstyle-updates-detail-panel-but-doesnt-serialize/427747>\
**Category:** UI\
**Tags:** style, details-panel-ui, unreal-engine, slate, Widget, question, UMG\
**Created:** [June 19, 2018, 11:48pm UTC](https://forums.unrealengine.com/t/using-ubutton-setstyle-otherstyle-updates-detail-panel-but-doesnt-serialize/427747 "2018-06-19T23:48:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Doublezer0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Doublezer0](https://forums.unrealengine.com/u/Doublezer0)\
**Post date:** [June 19, 2018, 11:48pm UTC](https://forums.unrealengine.com/t/using-ubutton-setstyle-otherstyle-updates-detail-panel-but-doesnt-serialize/427747/1 "2018-06-19T23:48:06Z")

</div>

Hey,

Bit if back story to this one.

I have a detail customization. An action of this is the set the style of the selected Widget in a WidgetBlueprint.  
eg. User selects a button they have in the graph

When I use `TargetButton->SetStyle(SelectedStyle);` followed by `TargetButton->SynchronizeProperties();`

the detail panel is updated, also the Widget in the graph/designer is updated.

However it doesn’t mark it as Dirty and therefore doesn’t save. Am I doing this completely wrong? Is there a way to make sure when UButton::WidgetStyle is set, that it is saved as part of the reflection system?  
I have tried manually marking it as dirty and also tried calling ::Modify() //which returned false;

Thanks

---

<div class="post-metadata">

**Author:** ![Doublezer0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Doublezer0](https://forums.unrealengine.com/u/Doublezer0)\
**Post date:** [June 22, 2018, 1:02am UTC](https://forums.unrealengine.com/t/using-ubutton-setstyle-otherstyle-updates-detail-panel-but-doesnt-serialize/427747/2 "2018-06-22T01:02:25Z")

</div>

My bad here. I was using a transient reference. I directly modified the asset using the Asset Registry and it worked.  
Big thanks to Eduard Gelbling.
