Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
860
Missing "WorkbookUserDefinedStyle" Class
posted

Hi,

while working with the Infragistics Excel Engine in ASP.NET, especially with styles, I stumbled upon an exception "Unable to cast object of type 'Infragistics.Documents.Excel.WorkbookUserDefinedStyle' to type [...]". Besides the facts that I made a mistake in my code and that a user defined style can be cast as a WorkbookStyle like here:

WorkbookStyle style = (WorkbookStyle)workBook.Styles["StyleName"];

I have two questions:

  1. Why is a user defined workbook style of type "WorkbookUserDefinedStyle" and could I have any advantages using this type?
  2. Why does the type "WorkbookUserDefinedStyle" not appear in the documentation and/or is declared "private"?

Just because I'm curious...

Parents
No Data
Reply
  • 44743
    Verified Answer
    posted

    WorkbookUserDefinedStyle is an internal type. The error message you are seeing is likely a bug in the Excel library. I have forwarded this post to the Developer Support Manager and a DS engineer will be contacting you about this issue.

    With regard to your questions, the WorkbookUserDefinedStyle is not exposed because it does not provide any useful functionality beyond that of WorkbookStyle (its base class). It is simple used to store a custom name, which a built-in style does not need to store, and which is accessible via the WorkbookStyle.Name property.

Children