Thanks for the answer.
Perhaps there is a way to select a row with the right button?
We regret to inform you that, there is no way to select a row with right click of mouse. We have logged feature request for the same. We will implement this feature in any of our upcoming release. We will let you know once we implemented the feature.
You can track the status of this report through the following feedback link,
https://www.syncfusion.com/feedback/41071/provide-support-to-select-a-row-on-mouse-right-click
We regret that we will be unable to implement the feature "Provide an event support to listen the mouse right click" in our 2023 Volume 1 main release, as promised. The feature will be included in our 2023 Volume 1 SP release, which is scheduled for the end of April 2023. We will notify you once the feature is available. We appreciate your understanding until then.
Due to complexities to provide support in MacCatalyst, we are unable to include the feature in Volume 1 SP release. We will complete and implement the feature in Volume 2 release which is scheduled on end of June 2023. We appreciate your patience until then.
We apologize for not being
able to include the mentioned feature in our 2023 Volume 2 main release as
initially promised. Instead, it will be incorporated into our 2023 Volume 2 SP
release, planned in the month of August 2023. Once the feature is available, we will inform
you. In the meantime, we appreciate your patience and understanding.
Nikolay,
We are glad to announce that our Essential Studio 2023 Volume 2 Service Pack Release V22.2.5 is rolled out with the implementation of “RightClick” support in SfDataGrid and is available for download under the following link.
We are pleased to share that we have attached a sample project and a code snippet for your reference. These resources demonstrate how users can effectively utilize the RightClick Event in SfDataGrid. This event allows users to implement custom functionalities and interactions when users right-click on specific elements within the DataGrid. We hope that the provided sample and code snippet will assist you in incorporating this feature into your application with ease.
Code snippet:
public MainPage() { InitializeComponent(); dataGrid.CellRightTapped += DataGrid_CellRightTapped; } private void DataGrid_CellRightTapped(object sender, Syncfusion.Maui.DataGrid.DataGridCellRightTappedEventArgs e) { //Your code here } |
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Nirmalkumar
It Works! 😍
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help.
Yes, it works, thank you. But there is an issue.
My task is to get a context menu for a selected item. To do this, I need to select a row by right-clicking.
I'm doing it like this:
dataGrid.SelectedIndex = e.RowColumnIndex.RowIndex;
Everything is fine, it works.
But if I change the collection bind to ItemSource, when I right-click on this row, I get an error: "System.InvalidOperationException: 'RowData is null in Find is not a valid operation'"
SelectedItem is also bind as TwoWay, and when I make changes in my VM, I get the same error on the line:
OnPropertyChanged(nameof(SelectedItem));
Despite the fact that the data is there, the value in SelectedItem is correct.
upd.
Interesting. Left-click for selection works as expected, no errors. And after left-click, right-click also functions normally.
Hi Nikolay,
Changing the item source at runtime may result in a "System.NullReferenceException: 'Object reference not set to an instance of an object" exception within the DataGrid. This was a known issue on our end, alongside other item source manipulation issues. We've addressed all of these issues, and the fix will be incorporated into our upcoming Vol. 3 release, expected in mid-September.
However, based on the information you've provided, it appears that the exception you're encountering might be different from the one we've addressed. To provide you with more accurate assistance, we kindly request that you share the stack trace associated with the problem. This will enable us to compare it with the previous exception and work towards a more feasible solution for your specific case.
Regards,
Nirmalkumar
System.InvalidOperationException HResult=0x80131509 Message=RowData is null in Find is not valid operation Source=Syncfusion.Maui.DataGrid StackTrace: at Syncfusion.Maui.DataGrid.GridSelectedRowsCollection.Find(Object rowData) at Syncfusion.Maui.DataGrid.GridSelectedRowsCollection.Contains(Object rowData) at Syncfusion.Maui.DataGrid.DataGridRowSelectionController.<>c__DisplayClass27_0.
Nikolay,
Based on the information you have provided, we've compared the stack trace to the issues we've previously encountered, but they don't match. We have been unable to reproduce the reported issue on our end. However, we understand that you are still experiencing difficulties, and we are committed to helping you resolve the issue as quickly as possible. In order to further investigate the problem, we kindly request that you provide us with the specific sample that is causing the issue. Alternatively, you can modify the attached sample to make it reproducible so that we can investigate and provide a solution in a timely manner.
Regards,
Nirmalkumar