Setting pane.Size in code does not result in a resized splitter pane

I created an SfSplitter on my page, and set @ref variables for each pane.  On the Resize event, I save the pane sizes to my database.  Then, when the user goes back to the page, it loads the sizes and sets them to the saved values.  However, the panes do not end up resized.


I tried setting it in the OnInitializedAsync, OnAfterRenderAsync, and also by creating a SfSplitter Create event handler - none of those places resized the pane on page load.


Is there something I am missing, or doing wrong?


```

                        <SfSplitter Height="100%" Width="100%" Orientation="ViewOrientation" EnablePersistence="true">

                            <SplitterEvents Created="SplitterCreated"

                                            OnResizeStop="UpdateBatchSettings"></SplitterEvents>

                            <SplitterPanes>

                                <SplitterPane @ref="ImagePane" Size="600px">

                                    <ContentTemplate>

                                        <div class="image-editor-container">

                                            <SfImageEditor @ref="PageEditor" Height="100%" Width="100%" Toolbar="toolbar">

                                                <ImageEditorEvents Created="LoadPage"

                                                                   ToolbarItemClicked="ToolbarItemClicked">

                                                </ImageEditorEvents>

                                            </SfImageEditor>

                                        </div>

                                    </ContentTemplate>

                                </SplitterPane>

                                <SplitterPane @ref="ValidationPane" Size="200px">

                                    <ContentTemplate>

                                        Page Signature Content <br />

                                        Page Unreadable<br />

                                        Next, Prev page buttons, Timer - expiration, 1-time use button: add 30 minutes

                                    </ContentTemplate>

                                </SplitterPane>

                            </SplitterPanes>

                        </SfSplitter>

```


2 Replies

CE Coda Error Analysis June 3, 2024 08:30 PM UTC

Ah, never mind!  I figured out my issue.  Instead of setting the ref object .Size, I should use the Size="" parameter in the <SfSplitter> tag and just set the variable.  I'm good!



PK Priyanka Karthikeyan Syncfusion Team June 5, 2024 11:59 AM UTC

Hi Coda Error Analysis,

We're delighted to hear that the issue you reported has been resolved on your end. Should you require any additional assistance, please don't hesitate to reach out to us

Regards,

Priyanka K


Loader.
Up arrow icon