Add custom XAML control in cell of SfSpreadsheet

Sir, is there any way to add a custom XAML control in a cell in SfSpreadsheet. For example a custom drop down box that shows country names with a little image of their flag? Or drop down box with different font styles for different items etc?
 
James

3 Replies

TL Thirumurugan Loganathan Syncfusion Team January 17, 2018 11:20 AM UTC

Hi James,  
  
You can achieve the requirement “Load custom xaml control in SfSpreadsheet” by customizing a cell with Data template. Please refer the below UG documentation for cell customization.  
  
  
Regards,  
Thirumurugan  



JA James February 2, 2018 06:47 AM UTC

Thankyou.

The example shown overrides the spreadsheet column class, to create the custom xaml code in every cell in a given column.

But how do I do this just for once cell?  say $B$4  . And then if the user inserts a new column in A, the custom xaml control remains in the same relative cell, now being in cell $C$4 after the column is inserted?

What I am trying to achieve is a custom drop down list. Your existing cell validation list is limited to 256 characters in the list. I'd like a drop down of country names, with their flags. I can do the xaml for that, but getting into only a few certain cells is proving very difficutl


TL Thirumurugan Loganathan Syncfusion Team February 27, 2018 10:24 AM UTC

Hi James, 

Please find the below details, 

S.No 
Query 
Comments 
 
Need to load data template on only one cell and need to move adjacent column when new column is inserted. 

You can achieve these requirements by specifying the particular row index and column index at QueryRange event of the spreadsheet. Please find the given sample for more details. 
 
Sample 

Need to load the custom dropdown list on particular cells. 


 
Regards, 
Thirumurugan 


Loader.
Up arrow icon