Hi Tommie,
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.
Sample: http://www.syncfusion.com/downloads/support/forum/119319/ze/CellTemplateSelector_SfDataGrid580013410
Please let us know if you have any concerns.
Regards,
Muthukumar K
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
Hi Tommie,
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,
UG link: http://help.syncfusion.com/ug/wpf/index.html#!Documents/gridtemplatecolumn.htm
Please let us know if you require further assistance on this.
Thanks,
Ashok
Hi Tommie,
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.
Regards,
Muthukumar K
Hi Tommie,
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.
ScreenShot: http://www.syncfusion.com/downloads/support/forum/119319/ze/ScreenSot1159599775
Could you clarify your requirement based on this sample and update us? This will help us provide a solution.
Regards,
Muthukumar K
Hi Tommie,
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.
Screenshot: http://www.syncfusion.com/downloads/support/forum/119319/ze/Screenshot-408070851
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.
Regards,
Muthukumar K