Date Cell Type error

Posted by: ebw on 8 September 2017, 1:34 pm EST

  • Posted 8 September 2017, 1:34 pm EST

    I am trying to create a date cell type with a user defined format (MM/YYYY).

    When I try to type in a value I get an error. {"startIndex cannot be larger than length of string.\r\nParameter name: startIndex"}

    I attached a small app for you to try.

    <FONT size=2>

    datecell = </FONT><FONT color=#0000ff size=2>New</FONT><FONT size=2> FarPoint.Win.Spread.CellType.DateTimeCellType

    datecell.DateSeparator = </FONT><FONT color=#a31515 size=2>"/"

    </FONT><FONT size=2>

    datecell.MaximumDate = </FONT><FONT color=#0000ff size=2>New</FONT><FONT size=2> System.DateTime(2100, 1, 1)

    datecell.MinimumDate = </FONT><FONT color=#0000ff size=2>New</FONT><FONT size=2> System.DateTime(1990, 12, 31)

    datecell.DateTimeFormat = FarPoint.Win.Spread.CellType.DateTimeFormat.UserDefined

    datecell.UserDefinedFormat = </FONT><FONT color=#a31515 size=2>"MM/YYYY"


    Thanks. ebw

  • Replied 8 September 2017, 1:34 pm EST

    Your UserDefinedFormat is incorrect...

    <font size="2">datecell.UserDefinedFormat = </font><font size="2" color="#a31515">"MM/YYYY"</font>

     should be

    <font size="2">datecell.UserDefinedFormat = </font><font size="2" color="#a31515">"MM/yyyy"</font>

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels