Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
DanielSH
Frequent Visitor

Force redraw of formatting panel

Not sure if I'm missing something obvious or if I'm doing something I'm not supposed to...

In my custom visual I allow my users to upload some pictures in Advanced Edit mode, and later on I'd like to allow them to select these pictures in the formatting panel in a drop-down.

 

I'm able to implement all of this, the only problem is that I need to resize my visual to trigger a redraw of the formatting panel so the content of the drop-down is actually updated. I tried explicitly calling getFormattingModel(), but it makes no difference.

 

I put together a simplified project to demo this behavior.

 

Steps to reproduct the problem:

1. Start the visual, and navigate to the formatting panel: see that the "Default color" formatting slice is disabled

2. Click the "Populate dropdown values" button on the visual itself: see that the array that previously showed empty is now showing some values on the visual. The "Default colors" formatting slice is still disabled

3. Resize the visual: this will trigger a re-initialization of the formatting settings, and now "Default color" becomes enabled, and the drop-down has the same values as the array.

Source code is here: https://github.com/DanielSzentimrey-Harrach/formatPaneUpdateExample/tree/master

 

Again, my question is how to trigger the formatting panel redraw programmatically, without the need to resize my visual.

I looked at this page in the documentation, but still couldn't figure out how to do it.

https://learn.microsoft.com/en-us/power-bi/developer/visuals/power-bi-visuals-concept

 

Any help would be much appreciated,

Daniel

1 ACCEPTED SOLUTION
DanielSH
Frequent Visitor

Answering my own question: after some more digging around I found that the IVisualHost interface contains a function called refreshHostData(); Calling this function programmatically will lead to a redraw of the formatting panel without the need to resize the visual.

View solution in original post

2 REPLIES 2
Covid19
Frequent Visitor

Excellent! I have been looking for a way to dynamically update data in the drop-down list of the formatting panel for a long time. Thank you.

DanielSH
Frequent Visitor

Answering my own question: after some more digging around I found that the IVisualHost interface contains a function called refreshHostData(); Calling this function programmatically will lead to a redraw of the formatting panel without the need to resize the visual.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors