Using MapTo with a text field

I am trying to bind a text input on the lightbox to a field in my database, but this code doesn’t work.

var TimesheetNote = scheduler.Lightbox.Add(new LightboxText("text", "Timesheet Note to User")); TimesheetNote.MapTo("TimesheetNote");

How do I map my text entry to a database field?

Thanks for your assistance.

Sorry actually my code is

var timesheetNote = scheduler.Lightbox.Add(new LightboxText("text", "Timesheet Note to User")); timesheetNote.MapTo = "TimesheetNote";

But the first line throws an error.

Hello,
scheduler.Lightbox.Add does not return a value (i.e. void), so you should have received a compile error. Try following

scheduler.Lightbox.Add(new LightboxText("text", "Timesheet Note to User") { MapTo = "TimesheetNote" });

Thanks Aliaksandr, got that working :smiley:

We will be purchasing multiple copies of the scheduler for our clients so your assistance is much appreciated!