Passing paramaters using Link control

Hi
I'm looking to display a Datalist with an edit template. This works fine when I display simple content - I can use embed html with dynamic data ${data.MyField} no problem for example. What I want to do it to allow the user to click on the item to bring up the edit page for that item. I cant see any event on the Datalist for this?

So I tried adding a link.
I can add a Radzen Link control but it wont let me pass a parameter (the PK of the record to edit). what ever parameter I add in designer, its not being rendered, only the url is.
I can get it to work if I pass the PK - in this case a guid hard coded

 <RadzenLink Path="edit-project/E64C3D79-F2F9-4D91-ADD0-509E7A058203" Text="Edit Project" class="card-link" />
but not
 <RadzenLink Path="edit-project/${data.ProjectID}" Text="Edit Project" class="card-link" />

errors with: Component attributes do not support complex content (mixed C# and markup)

So my questions are:

  1. Best way of implementing an item click from a datalist
  2. Best way of implementing a Link control with url and dynamic parameter
  3. Best way of implementing dialog pop up for edit page when link clicked?

Thanks as always for a great product
Tim

Hi @timt,

Best way of implementing an item click from a datalist

The Radzen DataGrid uses RadzenButton and handles its Click event to do everything - open dialogs etc.

Best way of implementing a Link control with url and dynamic parameter

The RadzenLink has Parameters property:

Best way of implementing dialog pop up for edit page when link clicked?

Probably via RadzenButton and its Click event.

Hi Thanks for the steer

Adding a button to the datalist template enabled me to add handlers etc. I was hoping to use the link but that seems not able to. Even adding a fixed parameter does not work in designer for the link, the html that gets rendered is:

<a href="edit-project" parameters="[{'name':'ProjectID','value':'fcc16776-6aa9-4d8f-8728-de9bb9ea3ad4'}]" class="link"><!--!-->
        <span class="link-text">Edit</span><!--!-->
    </a>

Thanks