Open context menu programatically

Hello


The context menu in a Datagrid opens on right click desktop and long press on mobile/small screens.  Is it possible to open the context menu in code on say the OnRecordClick event?

tHA



3 Replies 1 reply marked as answer

SP Sarveswaran Palani Syncfusion Team August 1, 2023 01:37 AM UTC

Hi Ditchford,

Greetings from Syncfusion support.

Based on your query, it appears that you want to open the context menu programmatically using a button click. We would like to inform you that we currently do not have any public methods to directly open the context menu programmatically.


However, you can perform context menu operations individually using the following methods, depending on your specific requirements:


Items

Description

API References

AutoFit

Auto fit the current column.

AutoFitColumnsAsync

Edit

Edit the current record.

StartEditAsync

Delete

Delete the current record.

DeleteRecordAsync

Save

Save the edited record.

EndEditAsync

Cancel

Cancel the edited state.

CloseEditAsync

Copy

Copy the selected records.

CopyAsync

PdfExport

Export the DataGrid data as Pdf document.

ExportToPdfAsync

ExcelExport

Export the DataGrid data as Excel document.

ExportToExcelAsync

CsvExport

Export the DataGrid data as CSV document.

ExportToCsvAsync

Group

Group the current column.

GroupColumnAsync

Ungroup

Ungroup the current column.

UngroupColumnAsync

SortAscending/

Descending

Sort the current column in ascending/ descending order.

SortColumnAsync

First/NextPage

Go to the first/next page.

GoToPageAsync

 
Please refer to the provided API links for more details on each context menu item. If you have any further queries, please get back to us.

Regards,

Sarvesh



DI Ditchford August 2, 2023 10:24 PM UTC

Hello


Thanks, I have achieved this with a separate component using your context menu control (SfContextMenu). I can call this on the click event.

Thanks anyway.  Please close.


Marked as answer

SP Sarveswaran Palani Syncfusion Team August 4, 2023 04:12 AM UTC

Thanks for an update,

 

From your query, we suspect that your issue has been resolved on you own.

 

If you have any further queries, please get back to us.



Loader.
Up arrow icon