Changing the visible property server side not working

1 Answer 71 Views
NumericTextBox
Ryan
Top achievements
Rank 1
Ryan asked on 09 Apr 2024, 02:42 PM

I have a RadNumericTextbox where the visible field is set to false. Depending on another variables value, the  RadNumericTextbox visible may change to true. This is not working. The field is in a panel.

I stepped through the code and the visible property will not change.

I even directly changed the value to true and the value remained false in the watch list.

 

1 Answer, 1 is accepted

Sort by
0
Vasko
Telerik team
answered on 11 Apr 2024, 11:34 AM

Hello Ryan,

I tested with the following code based on the provided details, and I was able to manipulate the Visible property of the NumericTextBox: 

<asp:Panel ID="panel1" runat="server">
    <telerik:RadNumericTextBox ID="numerbox1" runat="server" />
</asp:Panel>

<telerik:RadCheckBox ID="checkbox1" runat="server" OnCheckedChanged="checkbox1_CheckedChanged" />
protected void checkbox1_CheckedChanged(object sender, EventArgs e)
{
    RadCheckBox checkBoix = (RadCheckBox)sender;

    if (checkBoix.Checked == true)
    {
        numerbox1.Visible = true;
    }
    else if (checkBoix.Checked == false)
    {
        numerbox1.Visible = false;
    }
}

Note that this is just a guess of what the actual code used in your scenario is, and I'd like to ask you to adjust it to match the actual code, causing this odd behavior.

Kind regards,
Vasko
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
Tags
NumericTextBox
Asked by
Ryan
Top achievements
Rank 1
Answers by
Vasko
Telerik team
Share this question
or