>Dim prop = dataSource.GetType().GetProperty(boundField, BindingFlags.IgnoreCase Or BindingFlags.Public Or BindingFlags.Instance) >If prop <> Nothing Then > ' Property exists. >>
Dim loLabel As Framework.LabelFunction = New Framework.LabelFunction(oProcess) ' Get a reference to the property loPropertyInfo = loLabel.GetType().GetProperty("c" + lcKey, System.Reflection.BindingFlags.IgnoreCase Or _ System.Reflection.BindingFlags.Public Or System.Reflection.BindingFlags.Instance) ' If the property exists If Not loPropertyInfo Is Nothing Then End IfBut, it always execute as the property does not exist. It never gets into the If condition. I verified "c" + lcKey. And, it does say cExportToExcel. In the LabelFunction class, I do have a public property cExportToExcel. I cannot understand what it always say that it is nothing.