public DxSpreadsheetControlTemplateData GetTemplateData(SpreadsheetControl spc) { var data = new DxSpreadsheetControlTemplateData(); var arr = spc.SaveDocument(DocumentFormat.Xlsx); data.Content = Base2e15.Encode(arr); return(data); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (((context != null) && (context.Instance != null)) && (provider != null)) { this.iwfes = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (this.iwfes == null) { return(value); } DxSpreadsheetControlTemplateData data = value as DxSpreadsheetControlTemplateData; if (data != null) { SpreadSheetDesigner designer = new SpreadSheetDesigner(Base2e15.Decode(data.Content)); designer.ShowDialog(); byte[] byts = designer.SpreadsheetControl.SaveDocument(DocumentFormat.Xlsx); DxSpreadsheetControlTemplateData data1 = new DxSpreadsheetControlTemplateData { Content = Base2e15.Encode(byts) }; value = data1; } } return(value); }
public void SetTemplateData(SpreadsheetControl spc, DxSpreadsheetControlTemplateData value) { spc.LoadDocument(Base2e15.Decode(value.Content), DocumentFormat.Xlsx); }