I have a rather complex time editing template form I have been working on. Today, I made some change (not sure what) and the entire form is gone and replaced by the following error text:
The type or namespace name 'IReadOnlyRadzenDictionary<,> could not be found
I am unsure how to recover the template form in the editor? I am at a standstill.....
You can restore a previous state of the page from source control. If this doesn't work you can send us your application to info@radzen.com (beware we have an email attachment limitation set to 10MB).
Ok, figured it out. The Radzen IDE isn't properly handling C# "forward declarations" for classes used with RadzenDropDown components used in a data binding.
namespace DeviceUi2.Pages
{
public partial class TimeSettingsComponent : IDisposable { }
public partial class FMUTimeSettings
{
public TimeSettingsComponent parent { get; set; }
public string timeZone { get; set; }
public List<string> timeZones { get; set; } = null;
...........
public partial class TimeSettingsComponent : IDisposable {
........more code here
}
I am refactoring this code, as it's pretty bad, but there is a "parent" property that is holding the parent object of this class that is used internally by the class. This code will compile and run fine in VS or Radzen, but the visual editor has the "The type or namespace name 'IReadOnlyRadzenDictionary<,> could not be found" is displayed instead of the dropdown box. The app executes fine, and the dropdown works and is displayed correctly. It's in the editor display is where I see the error message.
If I comment out the "public TimeSettingsComponent parent { get; set; }" property, the dropdown is correctly displayed in the radzen editor. Or, if I clear the Data property from the dropdown, it is displayed correctly in the editor also. The Data property for the dropdown is set to the "timeZones" property in this class. The Value is set to the "timeZone" property.
I also do a lot of C++ still and I realize this isn't a real "fowards declaration". Plus, I'm gonna rework this code to get rid of the parent. But I guess having multiple C# partial class blocks really is difficult to handle in the Radzen editor parser?
Thanks!
To be honest I am not sure if this is causing the problem. The error saying there is no IReadOnlyRadzenDictionary
is correct as indeed there is no such type. Do you have a property of type IReadOnlyDictionary somewhere?
Nope, I never have seen that class before...I have no idea what it is??
This project builds with NO errors and runs fine. The only problem I have is with the Radzen visual designer. I would think a missing "using" would fail the project compile, wouldn't you?
Also, if I comment out the line like this:
// public TimeSettingsComponent parent { get; set; }
and save the file, I then re-bind the "Data" property to this same class and then the designer shows the component correctly and does not show an error message. Sounds like a bug in Radzen perhaps? Maybe in the realtime parser part of the visual editor code. Now that I know what to watch out for, it's not really a problem as I can work around the bug.
I think this behavior could be replicated in a simple example perhaps? If I get some time, I'll try to create a very simple example.....
enchev:
I see there are previous reports for the same error however we were unable to replicate it so far:
UPDATE: I was able to replicate it! It is related to component with template inside RadzenSplitter!
We will do our best to provide fix later this week!