Hi,
We are trying to upgrade “aspose.cells” from v20 to v24 and found that “IsCellAutoFit” property is obsolete and we have to use the “AutoFitRows/Columns(AutoFitterOptions)” function. But my question is earlier, we were simply setting the “IsCellAutoFit” to true, but now the “AutoFitterOptions” object has so many properties and we are not sure, what is the “exact equivalent” that we need to set to maintain our earlier implementation.
Below is our old code:
> public static ImageOrPrintOptions GetImageOrPrintOptionsSettings(Worksheet sourceWorksheet)
> {
> ImageOrPrintOptions imageOrPrintOptions = new ImageOrPrintOptions();>
> imageOrPrintOptions.IsCellAutoFit = true;
> return imageOrPrintOptions;
> }
Here is our new code:
> public static ImageOrPrintOptions GetImageOrPrintOptionsSettings(Worksheet sourceWorksheet)
> {
> ImageOrPrintOptions imageOrPrintOptions = new ImageOrPrintOptions();>
> //imageOrPrintOptions.IsCellAutoFit = true; // Cannot use Obsolete now,
> AutoFitterOptions autoFitterOptions = new AutoFitterOptions(); *//How do we construct object to match with previous implemenation of "isCellAutoFit = true"?*
> sourceWorksheet.AutoFitColumns(autoFitterOptions);
> sourceWorksheet.AutoFitRows(autoFitterOptions);
> return imageOrPrintOptions;
> }
Please let us know, How do we update our new code to construct “AutoFitterOptions” object so that it matches with our existing implementation of “IsCellAutoFit = true”?
Regards,
Prathap