How to debug compile error

Hi

I have generated Master/Details pages, however i now get this compile error:

error CS1061: 'DataGridRowMouseEventArgs' does not contain a definition for 'rID' and no accessible extension method 'rID' accepting a first argument of type 'DataGridRowMouseEventArgs' could be found (are you missing a using directive or an assembly reference?)

How does one debug this?

Xarion

Some more info on the above...
the problem only occurs when creating a Master/Detail DataGrid, Master/Detail Hierarchy is no problem.

Xarion

You can compile the project in visual studio to get the exact error location in code.

I'm getting the same error. Debugging isn't the issue. When you put in an attempted fix, Radzen replaces the code when you attempt to run the project.

Here is the error I'm receiving:
|Error|CS1061|'DataGridRowMouseEventArgs' does not contain a definition for 'Id' and no accessible extension method 'Id' accepting a first argument of type 'DataGridRowMouseEventArgs' could be found (are you missing a using directive or an assembly reference?)|VendorSignInLog|C:\Development Projects\Blazor\VendorSignInLog\server\Pages\Visit.razor.designer.cs

Here is the code from VS:
protected async System.Threading.Tasks.Task Grid0RowDoubleClick(DataGridRowMouseEventArgs<VendorSignInLog.Models.ByVendorSil.Visit> args)
{
await DialogService.OpenAsync("Edit Visit", new Dictionary<string, object>() { {"Id", args.Id} });
}

Has anyone solved this? I'm kind of dead in the water with my project right now.

1 Like

DataGridRowMouseEventArgs is an object that does not include "Id" as a property and that is why you get the error.

However, i see what you are trying to do. If you want to access the object on the row you clicked on you have to use "args.Data" and in your case you want to change "args.Id" to "args.Data.Id" if you have a property on the object that is called "Id" :slight_smile:

1 Like

Last night's update has resolved my problem.

Hi there, I run Blazor Web Assembly App on .NET5 and Radzen 2.63.7.
If I use "RowDoubleClick" event on a DataGrid to open the Edit-Dialog for ${event.id}, I get the same error as described above:

error CS1061: 'DataGridRowMouseEventArgs' does not contain a definition for 'id' and no accessible extension method 'id' accepting a first argument of type 'DataGridRowMouseEventArgs' could be found (are you missing a using directive or an assembly reference?) [PROJECT.csproj]

If I change ${event.id} to ${event.Data.id} as described above, it works perfectly.
Shouldn´t this work "out-of-the-box"?

Thanks in advance,

Martin

Yes, it works out of the box. Here is what I have with Master/Detail template using the latest Radzen:

The master DataGrid will use RowDoubleClick to edit record:

Thanks, but it doesn´t work out-of-the-box if I create a simple CRUD-Page:

  • at first, "RowSelect" event is prefilled
  • if I choose to use "RowDoubleClick", then I expect radzen to set the parameter value "correctly", but the value is set to ${event.id} instead of ${event.Data.id}

Changing the event type will not update the code used in the event - you should do that.

For information purpose (I have described the problem in more detail via email):

Hi Martin,

Indeed, Radzen displays wrong event argument for the DoubleClick event. We will address that with the next Radzen release.

Regards,
Atanas