Card Context Menu

I'm trying (and failing) to add a context menu to my kanban cards.  Doesn't look like the default styles are documented anywhere, so I'm not sure what to set as a target?  Also just putting the card template inside an SfContextMenu did not work.  Any chance you can provide a small example?

4 Replies

BS Balasubramanian Sattanathan Syncfusion Team October 7, 2020 01:02 PM UTC

Hi Jonah Coleman, 

Greetings from Syncfusion support. 

We have validated your requirement “Card Context Menu” at our side and prepared a sample based on that using the below code snippet. And we let you know that the target of the context menu should be the Kanban root element’s ID. For your reference, we have made a sample using the Kanban card template and context menu that can be downloaded from the below link. 

Code snippet
<SfContextMenu Target="#target" Items="@MenuItems" @ref="ContextMenuObj"> 
    <ContextMenuEvents TValue="MenuItem" ItemSelected="@select"></ContextMenuEvents> 
</SfContextMenu> 

<SfKanban @ref="KanbanObj" ID="target" TValue="TasksModel" KeyField="Status" DataSource="Tasks"> 

private void select(MenuEventArgs<MenuItem> args) 
    Console.WriteLine("Select event triggerred"); 

private void onCardClick(CardClickEventArgs args) 
    ContextMenuObj.Open(); 

Kindly try the above sample and let us know if you need further assistance. 

Regards, 
Balasubramanian S


JC Jonah Coleman October 20, 2020 05:16 PM UTC

I can successfully get the menu now, but haven't been able to figure out which card is clicked- there is a GetSelectedCards() method but it is deprecated and does not work.  I can't seem to find another way to discover what card(s) was selected.


JC Jonah Coleman October 20, 2020 05:18 PM UTC

Also in your example, I believe onCardClick is not used and unneccessary, if it makes a difference.


BS Balasubramanian Sattanathan Syncfusion Team October 22, 2020 03:04 PM UTC

Hi Jonah, 

Thanks for your reply. 

We have validated the requirement “to find another way to discover what card(s) was selected” and we regret to let you know that currently, we don’t have the in-built method to get card data. So we have considered this requirement as a feature improvement and logged the below feature feedback. The feature will be implemented and published in any of our upcoming releases.   


Regards, 
Balasubramanian S

Loader.
Up arrow icon