Hi,
I am having trouble getting cell specific data in response to a click event on an href that is defined in my row template.
Below is a rough idea of what I am doing.
<
RowTemplate
Context
=
"rowCtx"
>
<
td
>
<
a
href
=
"#"
id
=
"@(rowCtx.CellSpecificId1)"
@onclick="@(e => HandleClick(rowCtx.CellSpecificId)" @onclick:preventDefault>
</
td
>
<td>
<a href="#" id="@(rowCtx.CellSpecificId2)" @onclick="@(e => HandleClick(rowCtx.CellSpecificId)" @onclick:preventDefault>
</td>
<td>
<a href="#" id="@(rowCtx.CellSpecificId3)" @onclick="@(e => HandleClick(rowCtx.CellSpecificId)" @onclick:preventDefault>
</td>
</
RowTemplate
>
The problem seems to be that no matter what, the LAST rowCtx.CellSpecificId is passed to my event handler instead of the cell I want.
In the code above, if I click on teh first href, in the first <td>, I get the CellSpecificId3 instead of 1
Can someone share with me how to get a specific cell's value/id/whatever passed to the event handler? Seems like this should be easy, but it's not.
Basically, I want to pop a dialog that displays info for a clicked on cell. I am not married to the anchor tag. If there is a better way (i.e. one that works!), I'm all ears.
Thanks … Ed