Error TS2339: Property 'visible' does not exist on type 'NumericComponent'

Hello,
I am setting the visible component of a numeric input using this code:

this.mesDL.visible=false;

But I get error:
error TS2339: Property 'visible' does not exist on type 'NumericComponent'.

It seems stange to me because the "visible" property exists in radzen component editor.
Can you help me?
Thanks,
Mario

Indeed component instances don't have a real Visible property. You need to data-bind the Visible property to a page property and set the latter to false instead.

Ok I have followed your suggestions and it worked but now I have a bigger problem.
This is the javascript code:

var colore=this.idStandardColore.value;
if (colore==1) {
this.visibleSC=true;

        this.dlm.text="DL";
        this.dlp.text="DL"; 
        this.dam.text="Da";
        this.dap.text="Da";
        this.dbm.text="Db";
        this.dbp.text="Db";
        this.minm.text="valore";
        this.maxm.text="tolleranza +/-";
        this.minp.text="valore";
        this.maxp.text="tolleranza +/-";

}
if (colore==2) {
this.visibleSC=true;

        this.dlm.text="DL99";
        this.dlp.text="DL99";
        this.dam.text="Da99";
        this.dap.text="Da99";
        this.dbm.text="Db99";
        this.dbp.text="Db99";
        this.minm.text="valore";
        this.maxm.text="tolleranza +/-";
        this.minp.text="valore";
        this.maxp.text="tolleranza +/-";

}
if (colore==3) {
this.visibleSC=false;
//this.dlm.text="";
//this.dlp.text="";

        this.dam.text="DE-cmc";
        this.dap.text="DE-cmc";
        
        //this.dbm.text="";
        //this.dbp.text="";
        
        
        
        this.minm.text="DE max";
        this.minp.text="DE max";

}

if (colore==4) {
this.visibleSC=true;

        this.dlm.text="DL";
        this.dlp.text="DL";
        
        this.dam.text="Da";
        this.dap.text="Da";
        
        this.dbm.text="Db";
        this.dbp.text="Db";
        
        this.minm.text="min";
        this.maxm.text="max";
        this.minp.text="min";
        this.maxp.text="max";

}

visibleSC is bound to visible property of dlm dlp dam dap dbm dbp minm maxm minp maxp

If I switch from 1 to 2 or 4 it is all ok.
If I switch from 1 to 3 and then back to 1 (notice that on 3 I put visibleSC=false) minm and maxm and minp and maxp are not updated and I get a:

ERROR TypeError: Cannot set property 'text' of undefined
at EditRicocoComponent.EditRicocoGenerated.idStandardColoreChange (edit-ricoco-generated.component.ts:357)
at Object.eval [as handleEvent] (EditRicocoComponent.html:179)
at handleEvent (core.js:13540)
at callWithDebugContext (core.js:15049)
at Object.debugHandleEvent [as handleEvent] (core.js:14636)
at dispatchEvent (core.js:9955)
at eval (core.js:12294)
at SafeSubscriber.schedulerFn [as _next] (core.js:4331)
at SafeSubscriber.__tryOrUnsub (Subscriber.js:240)
at SafeSubscriber.next (Subscriber.js:187)

The strange thing is that dlm dlp and so on get updated! and they are all "labels"

Is it a bug?

Thanks,
Mario

Assigning the text property of labels directly won't work if a component is not visible. When you hide a component by settings its Visible property to false it becomes undefined (this is a quirk of the Angular framework that Radzen uses). What you should do instead is have page property which you should set instead and data-bind them to the Text property. You can check the properties section from the Radzen documentation if you haven't already.

For example this.dlmText and the Text property of the label set to ${dlmText}.

Ok thanks, I have chosen the workaround to not hide widget but put empty string.