Free Support Forum - aspose.com

Can you export Cell Controls

I am currently using combo cell control with GridDesktop and when I export the control to an excel file all that ends up in cell is control value not combo control.
So before I go to far down the rabbit hole. Are Cell controls expected to export or are they only available in Grid Desktop?

@SEMSDev,

Thanks for your query.

ComboBox form (MS Excel) controls are parsed fine with latest version/fix: Aspose.Cells.GridDesktop v18.4.2. Do you add GridDesktop combo box cell control via Aspose.Cells.GridDesktop APIs? If so, could you provide us a sample project with v18.4.2, we will check and may log a ticket for it.

Steps to reproduce
Load sample project
Press button 1 to setup screen
Press button 2 to export to excel
Step 3 look at values in e3 andf3 in excel they just show values.
AposeExcelGridExprotComboBox.zip (153.0 KB)image.png (12.0 KB)

@SEMSDev,

Thanks for the sample project with template file and screenshot.

I guess the feature is not supported as I did test your scenario/case using your sample project with your template file. I found cell controls (e.g ComboBox) created dynamically via Aspose.Cells.GridDesktop API does not render when saving/exporting the spreadsheet to MS Excel format.

I have logged the following ticket for your issue/requirements:

  • CELLSNET-46073 - Export cell controls (e.g ComboBox) to MS Excel format

Once we have an update on it, we will let you know here.

@SEMSDev,

Please use data validations for a workaround. Currently we don’t support controls related APIs and the import/export for controls. We will consider to implement it later on.

Thanks for the update.

Second question that is kind of related do you have the ability to put a date and/or time control on cell?

@SEMSDev,

Could you check if GridDesktop’s Date/Time validation type suits your needs? You may try GridValidationCollection and GridValidation classes in Aspose.Cells.GridDesktop APIs. Alternatively, you may apply your desired data validation in MS Excel in your template file and can import it into GridDesktop.

Can you point me to example of grid validation?

@SEMSDev,

See the following sample code for your reference:
e.g
Sample code:

.............
 private void Form1_Load(object sender, EventArgs e)
        {

            //Accessing the worksheet of the Grid that is currently active
            Aspose.Cells.GridDesktop.Worksheet sheet = gridDesktop2.GetActiveWorksheet();

            Aspose.Cells.GridDesktop.Style style = sheet.Cells["B7"].Style;
            style.Custom = "dd/mm/yyyy";
            sheet.Cells["B7"].SetStyle(style);


            Aspose.Cells.GridDesktop.Data.GridValidation validation = sheet.Validations.Add();

            validation.ValidationType = GridValidationType.Date;
            validation.Operator = GridOperatorType.Between;
            validation.Formula1 = "11/05/2010";
            validation.Formula2 = "12/05/2017";

            // Enable the error.
            validation.ShowError = true;
            validation.ErrorTitle = "Date Error";
            validation.ErrorMessage = "Enter a Valid Date";
            validation.InputMessage = "Date Validation Type";
            validation.ShowInput = true;

            GridCellArea area = new GridCellArea();
            area.StartRow = 6;
            area.StartColumn = 1;
            area.EndRow = 6;
            area.EndColumn = 1;
            validation.AddArea(area);
            validation.AddACell("B7");
            validation.IsRequired = true;

} 
........
private void gridDesktop2_CellValidationFailed(object sender, CellValidationEventArgs e)
        {
            e.Cell.PutValue(null);
        }
.........

Hope, this helps a bit.

Thanks for your fast repsone.
I will look into it.

The issues you have found earlier (filed as ) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan