Split columns

Good morning

I am c-reating a list of data with SfDataGrid, and there will be 5 columns that will contain the information of the medical event, and 5 columns that will contain the information of the mission (ambulance), I would like to make it so that if you click on the row, but in the columns of the medical event, it opens a context menu and double-clicking opens a window, and if instead I press in the same row, but in the columns of the mission, it opens another context menu and double-clicking opens another different window


I'll give you a quick example of the datagrid using a table

|                                   EVENT                                                     |                                          MISSION                                                    |

DateOperatorEventCityAddressDateMissionOperatorAmbulanceStatus
2024-09-07 15:30:00JONH.SMITH

Traumatic

MilanPiazza del duomo, 1 2024-09-07 15:32:00
245123456 JONH.SMITH
AMB_MI_178.A3

Direct to target

2024-09-07 15:35:00
JOHN.SMITHBLSDMilanPiazza del duomo, 20 2024-09-07 15:37:00
245123457
JONH.SMITH
AMB_MI_287.A1

Direct to target



8 Replies

DA Daniele September 7, 2024 10:13 AM UTC

I forgot to say that all the code of the sfDatagrid is not on XAML but is added in the C# class code



GS Gokul S Subramani Syncfusion Team September 9, 2024 01:20 PM UTC

Hi Daniele,


Based on the provided information, we are a little unclear about the requirement. However, we suspect that you intend to create and perform a specific action on a window when double-clicking on a cell. The issue arises when clicking on multiple cells, as multiple windows are created for each double-clicked cell, which seems improper. We have prepared a sample and attached a video reference for the issue you mentioned; please review this sample with your implementation.


If we have misunderstood the issue or if our implementation differs from yours, kindly share the relevant code snippets. If possible, try replicating the issue using our sample, or provide a sample where the issue is replicated. This will help us to provide a better solution.


Thank you for your understanding and cooperation.


Best Regards,

Gokul S


Attachment: WpfApp1_9931a759.zip


DA Daniele replied to Gokul S Subramani September 10, 2024 02:28 PM UTC

Hi,

I saw the video which is not entirely wrong, from the video you can see the datagrid, with two rows, and two parent columns "Events Details" and "Mission Datails", now what I want to do is the following, if I click any cell that is inside the parent column "Events Details" the program will do action A, if I click any cell inside the parent column "Mission Details" the program will do action B. example:


If I double click anywhere in the row (that is inside the parent column "Event Details") it will open the Event window, but if I do the same thing in the same row, but under the column "Mission Details" it will open the Mission window


Here is an example video (made with two separate datagrids!, I need a single datagrid, because in case there are more missions connected to the same event, the program must add the missions under the same event row without doubling the event data so the event row remains one, but with more mission rows (attacked)

Image_8670_1725978468865


Attachment: Registrazione_20240910_161038_40db21c3.zip


GS Gokul S Subramani Syncfusion Team September 11, 2024 05:03 PM UTC

Hi Daniele,

Thanks for the update. Based on the information provided, it seems you want to display the Mission and Events in a single DataGrid, with Mission details as the Parent and Event details as the Child. This can be achieved by using MasterDetailsView instead of two separate SfDataGrids. We have provided online user guide documentation for the Master Details View. Please refer to the UG link below:

UG Link:
Master Details View in WPF DataGrid control | Syncfusion

Additionally, we have prepared a sample with the DetailsViewDataGrid. Please review the sample. However, we are currently working on displaying the cell values in a new window when double-clicking on a cell, and we need more time to complete this requirement. We will provide an update on or before September 13, 2024.


Regards,

Gokul S



Attachment: SimpleMasterDetailsView_1fe76f02.zip


MA Manikanda Akash Munisamy Syncfusion Team September 13, 2024 01:22 PM UTC

Hi Daniele,

Thank you for your patience.
 
We have achieved your requirement using the MasterDetailsView, as you mentioned that one event can have many missions in your latest update. We have handled the CellDoubleTapped event and defined ContextMenu items separately for both the SfDataGrid (Parent) and the DetailsViewDataGrid (Child). A sample has been prepared and attached here along with the video recording for your reference.
 
Could you please review the sample and confirm whether it meets your requirements?

If we have misunderstood your requirements, kindly provide additional details regarding the issue you are facing. This will help us better understand the problem and offer an appropriate solution.
 
We look forward to your response.
 
Regards,
Manikanda Akash

Attachment: MasterDetailsView_7240fc2f.zip


DA Daniele October 15, 2024 10:26 PM UTC

Good morning

I apologize for the delay in responding, I saw the video,

it is partially incorrect, that is, the columns "MissionDate, MissionID, MissionOP, Mission Ambulance, Mission Status" must not be children of the Event columns, but rather placed side by side, let me explain better


112 sends an event card to the health emergency operations room, and the event card appears, subsequently the operator takes the information, and activates the necessary ambulances, and the connected mission (missions) will appear next to it


Exactly as in the example below, identical, now if I double-click anywhere on the event card it will do an action depending on the right or left button, and if I do the same thing on the mission card it will do something else, always taking into account that I have to insert buttons into the table that may or may not be present, depending on the situation


See images

https://imgur.com/a/BkkLFpV





MS Malini Selvarasu Syncfusion Team October 16, 2024 01:48 PM UTC

Hi Daniele,

Thank you for sharing the details regarding your requirements. We have reviewed the reported scenario and can confirm that displaying the columns side by side is not supported. However, we are currently exploring alternative controls to fulfill your requirement. We will need a bit more time to complete our analysis and will provide you with further updates by October 18, 2024.
Thank you for your patience and understanding as we work through this.
Regards,
Malini Selvarasu


MS Malini Selvarasu Syncfusion Team October 18, 2024 01:59 PM UTC

Hi Daniele,

Thank you for your patience.
As we already updated, we didn't have same structure in DataGrid control. However, we have closely implemented your requirements using the SfTreeGrid, displaying the Event and Mission columns side by side as you requested. We have handled the `CellDoubleTapped` event and customized the ContextMenu items separately for both the Event and Mission columns. A sample has been prepared and is attached here, along with a video recording for your reference. Please note that the layout differs slightly from your original template.
For further information about the SfTreeGrid, please refer to the user guide documentation for the SfTreeGrid:  Getting Started with WPF TreeGrid control | Syncfusion
Could you please review the sample and confirm whether it meets your requirements? If we have misunderstood any aspect of your request, kindly provide additional details regarding the issue you are facing. This will help us better understand the problem and offer an appropriate solution.
We look forward to your response.
Regards,
Malini Selvarasu

Attachment: SfTreeGrid_Demo_5681789e.zip

Loader.
Up arrow icon