Thank you for using Syncfusion products.
We analyzed your query but we are unable to reproduce the reported issue at our end. We have prepared simple sample based on your requirement. Please review the implementation in this sample. If you are still seeing the same issue, please modify this sample to reproduce the issue and send the modified sample back to us. This will help us to proceed further.
Please let us know if you have any concerns.
Hi Muthukumar ,
Thank you for your response. I was using a static CollectionViewSource for cell template, and it fails. After I changed as your sample data structure, it works okay. I have another question:
If CellTemplateSelector and EditTemplateSelector use different template, but it only shows the template from CellTemplateSelector. I also try to modify directly of your sample, it also only display the template from CellTemplateSelector. Even when I change the cell template to a simple template which only holds one textbox or textblock.
Thank you for your update.
In SfDataGrid we have support for CellTemplateSelector and EditTemplateSelector to GridTemplateColumn. You can achieve your requirement by using CellTemplateSelector itself. For your reference we provided a sample with both CellTemplateSelector and EditTemplateSelector in our previous update. EditTemplateSelector will be loaded when we edit the GridCell.
Please refer to the following UG link to find more details on the GridTemplateColumn,
Please let us know if you require further assistance on this.
We are not able to understand your inquiry. When you set both CellTemplate and EditTemplate, CellTempalte will load for display mode and EditTemplate will load when you are editing the cell. Could you therefore clarify this part of your question: "Celltemplate and EditTemplate are overlap them together"? Once we understand your requirement, we will be able to provide a solution.
Please review my response.
Thanks for the update.
In the sample you have provided TextBlock overlapped with Grid and now we have modified in the below sample,
Please refer the attached screenshot.
Could you clarify your requirement based on this sample and update us? This will help us provide a solution.
We analyzed your query. Based on your code, seems you are loading one SfDataGrid in CellTemplate and also in EditTemplate of GridTemplateColumn. So when you double click on the DataGrid loading inside template, it will load EditTemplate (which also has DataGrid). Please refer to the screenshot(image1).
Now if you double click DataGrid inside Cell (Loaded from EditTemplate), TextBox will load for the DataGrid inside DataTemplate. Please refer to the screenshot(image2). This is the behavior of DataGrid.
Do you want to edit the DataGrid inside Main DataGrid Cell? If so, it is not possible to edit in single click. But you can do this by double click by setting EditTrigger property to MainDataGrid and also by setting DataGrid inside Template.
Please let us know if we have not addressed your requirement.