radzenhq / radzen-blazor-studio

Sample applications created with Radzen Blazor Studio
https://www.radzen.com/blazor-studio
18 stars 3 forks source link

Method designer doesn't work for some DropDown events. #77

Closed koksalbasar closed 1 year ago

koksalbasar commented 1 year ago

Hi Guys,

When I try to create or add a method to the RadzenDropDown component's SelectedItemChanged event, RBS generates the following error.

Notes :

C:\Users\Administrator\source\repos\Valura_v2\server\Pages\Tenant.razor(101,278): error CS0407: Task TenantComponent.cmbCityChange(object)' has wrong return type
C:\Users\Administrator\source\repos\Valura_v2\server\Pages\Tenant.razor(322,175): error CS1662: Unable to convert lambda expression to requested delegate type because some of the return types in the block are not implicitly convertible to delegate return type
   at Radzen.Server.ProjectContext.Compile(Compilation compilation, AssemblyLoadContext context) in /Users/korchev/github/radzen-next/Radzen.Server/ProjectContext.cs:line 173
   at Radzen.Server.ProjectContext.Compile(Compilation compilation) in /Users/korchev/github/radzen-next/Radzen.Server/ProjectContext.cs:line 178
   at Radzen.Server.ProjectServer.Compile(String fileName, String source, RazorProjectEngine projectEngine) in /Users/korchev/github/radzen-next/Radzen.Server/ProjectServer.cs:line 1095
   at Radzen.Server.ProjectServer.CompilePage(String fileName, String source, RazorProjectEngine engine) in /Users/korchev/github/radzen-next/Radzen.Server/ProjectServer.cs:line 451
   at Radzen.Server.ProjectServer.Render(String fileName, String source) in /Users/korchev/github/radzen-next/Radzen.Server/ProjectServer.cs:line 706
   at Radzen.Server.ProgramController.Render(RenderRequest request) in /Users/korchev/github/radzen-next/Radzen.Server/ProgramController.cs:line 454
<RadzenDropDown TValue="string" Style="width: 100%" Data="@Globals.cities" TextProperty="CityName" ValueProperty="GeoNameId" SelectedItem="@selectedCity" @bind-Value="@selectedCity.GeoNameId" Name="cmbCity" Change="@cmbCityChange"></RadzenDropDown>, 1 of 2 found for 'cmbcity', at 101:223

ValueChanged event also causes the error.


In addition, some events can not show the method name on the Method Designer when it's created.

For example; When selecting RadzenDropDown ContextMenu from the Event tab, the Method Designer shows the method name on the designer Combobox.

image

But when selecting RadzenTextBox Change event the Method Designer doesn't show the name, but the method name is still there (CityNameChange in this example). This is not causing an error. The developer can continue with selecting the correct method name.

image
akorchev commented 1 year ago

Hi @koksalbasar,

We will handle the DropDown event issues with the next release.

I can't understand the second issue about RadzenTextBox change event.

koksalbasar commented 1 year ago

The second issue is not an error. But the developer can be confused when she/he tries to select the method name.

I'll try to explain. Please follow the steps to regenerate the issue.

A) Normal process :

1) Select the ContextMenu event from the RadzenDropDown component's Event tab and click the + sign.

image

2) Select the code page, give the name and click the OK button

image

3) RBS creates the method and selects the method name from the designer page.

image

B) The process with issue :

1) Select the Change event from the RadzenTextBox component's Event Tab and click the + sign.

image

2) Select the code page, give the name and click the OK button

image

3) RBS creates the method but does not select the method name from the designer page.

image

4) The method is already added to the method list.

image

As I said in the beginning this is not caused by an error but is confusing.

koksalbasar commented 1 year ago

Hi @akorchev, SelectedItemChanged@RadzenDropDown --> Solved ValueChanged@RadzenDropDown --> Solved Change@RadzenTextBox --> Solved

This issue is solved and closed