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
125
Problems WebDataGrid WebDatetimeEditor Edit Provider and Row Edit Template Date format
posted

Hello,

I'm using 15.1 CLR 4.5 WebDataGrid in VS 2013 with columns bound to an SQL DataSource. For date columns I've added a WebDateTimeEditor as an edit provider.  The WedDateTime editor's and the grid column's display and edit formats properties set to "g" and {0:g} (General Short Date and Short Time). When I attempt to edit any of the Date Time columns a JavaScript exception is thrown: "0x800a139e - JavaScript runtime error: Sys.FormatException: Input string was not in a correct format." I assume this is from the dynamically generated script. I noticed that script goes not contain a format option for "g" or "G":

Date._expandFormat = function Date$_expandFormat(dtf, format) {
    if (!format) {
        format = "F";
    }
    var len = format.length;
    if (len === 1) {
        switch (format) {
        case "d":
            return dtf.ShortDatePattern;
        case "D":
            return dtf.LongDatePattern;
        case "t":
            return dtf.ShortTimePattern;
        case "T":
            return dtf.LongTimePattern;
        case "f":
            return dtf.LongDatePattern + " " + dtf.ShortTimePattern;
        case "F":
            return dtf.FullDateTimePattern;
        case "M": case "m":
            return dtf.MonthDayPattern;
        case "s":
            return dtf.SortableDateTimePattern;
        case "Y": case "y":
            return dtf.YearMonthPattern;
        default:
            throw Error.format(Sys.Res.formatInvalidString);
        }
    }
    else if ((len === 2) && (format.charAt(0) === "%")) {
        format = format.charAt(1);
    }
    return format;
}

Is there anyway to force the "g" or "G" format to be excepted.

I am also having an issue with the Row Edit Template as well. No matter what control I use, whether it be a TextBox, WebDateTimeEditor, or WebMaskEditor with format settings the Datetime Columns always display in long date and time format. 

Please help. I at a complete loss at this point.

Thank you,

Parents Reply Children
No Data