We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ArgumentOutOfRangeException after assign CellStyleName with modifed Interior.Gradient

Thread ID:





119119 May 12,2015 12:45 PM UTC May 13,2015 09:28 AM UTC WinForms 1
Tags: XlsIO
stephan weyer
Asked On May 12, 2015 12:45 PM UTC

Hello together,

I need to set a gradient in cells. So i have to set the property "Interior" like i do in my sample

            ExcelEngine excelEngine = new ExcelEngine();
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2010;
            IWorkbook workbook = application.Workbooks.Create(2);
            IWorksheet sheet = workbook.Worksheets[0];

            IStyle style = workbook.Styles.Add("style1");
            style.FillPattern = ExcelPattern.Gradient;
            style.Interior.Gradient.GradientStyle = ExcelGradientStyle.Vertical;
            style.Interior.Gradient.BackColor = Color.Black;
            style.Interior.Gradient.ForeColor = Color.Beige;

            for (int i = 1; i < 2000; i++)
                IRange cell = sheet.Range[string.Format("A{0}", i)];
                cell.CellStyleName = "style1";


This code ends in ArgumentOutOfRangeException (in assignment cell.CellStyleName = "style1").

   bei Syncfusion.XlsIO.Implementation.Collections.ExtendedFormatsCollection.get_Item(Int32 index)
   bei Syncfusion.XlsIO.Implementation.RangeImpl.SetXFormatIndex(Int32 index)
   bei Syncfusion.XlsIO.Implementation.RangeImpl.set_ExtendedFormatIndex(UInt16 value)
   bei Syncfusion.XlsIO.Implementation.RangeImpl.ChangeStyleName(String strNewName)
   bei Syncfusion.XlsIO.Implementation.RangeImpl.set_CellStyleName(String value)
   bei Syncfusion.B002074.Form1.button1_Click(Object sender, EventArgs e) in d:\Test\Syncfusion.B002074\Syncfusion.B002074\Form1.cs:Zeile 61.

Only the assignments to property "Interior" seems to fail. I can modify all "direct" properties in style without any errors.
What can i do?

Thanks you for help

Dilli Babu Nandha Gopal [Syncfusion]
Replied On May 13, 2015 09:28 AM UTC

Hi Stephan,

We were able to reproduce the problem and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates


Please let me know if you have any questions.

Dilli babu.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon