Skip to content

Fix HideRunButton/ShowRunButton to persist state across layout updates#259

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-rdlviewer-run-button-issue
Draft

Fix HideRunButton/ShowRunButton to persist state across layout updates#259
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-rdlviewer-run-button-issue

Conversation

Copy link
Contributor

Copilot AI commented Oct 19, 2025

HideRunButton() and ShowRunButton() only set _RunButton.Visible, but RdlViewer_Layout() overrides button visibility based on the _ShowParameters field. This causes button state to revert on any layout recalculation.

Changes

  • HideRunButton() now sets _ShowParameters = false before hiding the button
  • ShowRunButton() now sets _ShowParameters = true before showing the button
  • Both methods call RdlViewer_Layout(this, null) to apply changes immediately

This matches the pattern used by the ShowParameters property setter.

public void HideRunButton()
{
    _ShowParameters = false;
    _RunButton.Visible = false;
    RdlViewer_Layout(this, null);
}

public void ShowRunButton()
{
    _ShowParameters = true;
    _RunButton.Visible = true;
    RdlViewer_Layout(this, null);
}
Original prompt

This section details on the original issue you should resolve

<issue_title>RdlViewer methods(Hide/ShowRunButton) not working!</issue_title>
<issue_description>As we know, the methods(ShowRunButton and HideRunButton) control the visibility of 'Run Report' Button.
But any method is not working.

For fixing the problem, add some codes in the source 'RdlViewer.cs'.

(Line 2145)
public void HideRunButton()
{
_ShowParameters = false; //<- Add this Line
_RunButton.Visible = false;
}

(Line 2150)
public void ShowRunButton()
{
_ShowParameters = true; //<- Add this Line
_RunButton.Visible = true;
}

I hope that this issue is resolved ASAP!</issue_description>

Comments on the Issue (you are @copilot in this section)

@majorsilence Please send a pull request with the fix and I'll merge it.

Fixes #179


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

…arameters field

Co-authored-by: majorsilence <656288+majorsilence@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix RdlViewer methods for showing and hiding run button Fix HideRunButton/ShowRunButton to persist state across layout updates Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RdlViewer methods(Hide/ShowRunButton) not working!

2 participants