DayPilot Forums

DayPilot is the best open-source Outlook-like calendar control for ASP.NET.
DayPilot Pro Demo (Calendar control)
» DayPilot Pro live demo (Calendar control)
DayPilot Pro Demo (Scheduler control)
» DayPilot Pro live demo (Scheduler control)
Home » How To » Reflection

Reflection

Hi,

I'm trying to use reflection to change some DayPilotScheduler properties but it doesn't work...

Do you have a code snippet/example that does it ? It would be appreciated and also useful
for other users.

Though, here's my code:

Assembly dayPilotAssembly = Assembly.LoadFrom(Server.MapPath("~") + "\\Bin\\DayPilot.dll");
Type schedulerType = dayPilotAssembly.GetType(DayPilot.Web.Ui.DayPilotScheduler");
object result = null;
object[] arguments = {16};
result = schedulerType.InvokeMember("HourFontSize",BindingFlags.Public | BindingFlags.SetFields, null, DayPilotScheduler1,arguments);

The error tells that I have a MissingFieldException, i.e., that HourFontSize doesn't exists.

Thanks,

Max
Anonymous - 6/12/2008 9:54:05 PM
I solved my problem:

PropertyInfo prop = schedulerType.GetProperty("HourFontSize");
prop.setValue(DayPilotScheduler1,"12", null);
Anonymous - 6/12/2008 10:46:02 PM
Thanks for posting the solution!
Dan Letecky - 6/13/2008 9:27:10 AM
Post reply