Accessing native control

This is a new one on me. I want to read the text out of a native text box and I typically do it like so…

EpiTextBox txtJob = (EpiTextBox)csm.GetNativeControl(“2233c0f7-d359-4959-8387-2a9b8395149b”);
Then use txtJob.Text for what I want to use it for, however, I am getting this error. Not sure what to do here. Does anyone know what I need to do?

Error: CS1061 - line 76 (245) - ‘Ice.Lib.Customization.CustomScriptManager’ does not contain a definition for ‘GetNativeControl’ and no extension method ‘GetNativeControl’ accepting a first argument of type ‘Ice.Lib.Customization.CustomScriptManager’ could be found (are you missing a using directive or an assembly reference?)

Something like this.

private EpiTextBox txtKeyField; within the public class Script section

I placed this within the InitializeCustomCode section.
this.txtKeyField = ((EpiTextBox)csm.GetNativeControlReference("46567b2e-6bc0-4967-be35-a0ec6843838f"));

This is getting Key1… Your GUID might be different.

2 Likes

That worked. A little different than what am used to doing but if it works, it works. Thank you.

1 Like