ContextMenu dont take data from right-clicked cell

Hi,

I have w problem with taking data from right-clicked cell to ContextMenu.

It looks like data is always taken from left-clicked(gray) cell. In belowe example it should take information from 17 Wed which i right clicked but insteed it take it from Fri 19. If no cell is "greyed" it work good.

I thought it was problem with my code, but its the same as yours in examples.

Even I checked it in your demo https://blazor.syncfusion.com/demos/scheduler/context-menu?theme=fluent and it works same.

Image_5082_1709241646111


1 Reply 1 reply marked as answer

RR Ram Raju Elaiyaperumal Syncfusion Team March 1, 2024 04:35 PM UTC

Hi Bartek,

I understand that you're experiencing an issue with the ContextMenu in the Syncfusion Blazor Scheduler. Specifically, the data is always taken from the left-clicked (greyed) cell, even when you right-click on a different cell.

The behavior you're observing is due to the initial cell being selected, and the data from this selected cell is being passed to the ContextMenu. This behavior is useful when multiple cells are selected and the ContextMenu is opened.

However, if you wish to open the ContextMenu for the cell that you right-click on, even if other cells are selected, you can achieve this by modifying your code slightly.

In the OnItemSelected method, you can modify ActiveCellsData to CellData, where CellData holds the value of the current cell.

public async Task OnItemSelected(MenuEventArgs<MenuItem> args)

{

    var SelectedMenuItem = args.Item.Id;

    var ActiveCellsData = CellData;

}

We have prepared a sample for you to illustrate this. Please check the sample : https://blazorplayground.syncfusion.com/rtrpZKjsoGEiLKPoI hope this helps. If you have any further questions or need additional assistance, please feel free to ask.Regards,

Ram


Marked as answer
Loader.
Up arrow icon