Search code examples
c#radio-buttonhidden

How to hide radio buttons in c#


I want to hide some radio buttons based on a value. How to do that?

I was trying this.

if(ArbeitsplatzId==400)
{
    //RbAmWartungRbRüstenRbRPMWartungRbSchichtwechsel
    RbAmWartung.Visibility = false;
    RbAmWartung.Visibility = "Hidden";            
}

in xaml code it's wotking with this: Visibility="Hidden"


Solution

  • You should Try the following:

    if (ArbeitsplatzId == 400)
    {
        RbAmWartung.Visibility = Visibility.Hidden;
    }
    

    The Visibilty property is used here. Learn more about it here.