GrapeCity Forums

The GrapeCity Message Boards
Welcome to GrapeCity Forums Sign in | Join | Help
in Search

lcidMsg

Last post 07-03-2009, 9:14 AM by StanKondrat. 4 replies.
Sort Posts: Previous Next
  •  06-30-2009, 3:07 PM 79690

    lcidMsg

    Hi,

     What is "lcidMsg" attribute and how can it be set programmatically (server-side or client-side)?

     I have a bilingual application that needs to display error messages in the language selected by the user. Specifically, I want to customize the

    "Can't set the data into the cell. The data type is not correct for the cell."

    message displayed when the invalid data is pasted into the cell.

    /Stan

    Filed under:
  •  06-30-2009, 3:49 PM 79693 in reply to 79690

    Re: lcidMsg

    Stan,

    It seems you are referring to the LCID property, it specifies how dates, times, and currencies are formatted. Locale identifiers (LCID)s are not the same for each geographical locale. You may refer to following online/previous articles to get an overview of the same:

    http://msdn.microsoft.com/en-us/library/ms525071.aspx

    http://msdn.microsoft.com/en-us/goglobal/bb964664.aspx

    http://www.clubfarpoint.com/Forums/forums/thread/20131.aspx

    Thanks


    Suresh Singh Dasila
    GrapeCity FarPoint
  •  06-30-2009, 4:35 PM 79696 in reply to 79693

    Re: lcidMsg

    Suresh,

     Thanks for your reply, but this doesn't answer my question. Even if I set Session.LCID to specific locale identifier, I'm still getting the hard-coded English message ("Can't set data into the cell. The data type is not correct for the cell.") when pasting incorrect data (e.g. text into numeric cells).

     The reason I asked about "lcidMsg" was that I found the following code fragment in fpspread.js file:

    this.SetValue=function (e5,h3,h5,x5,noEvent,recalc){

    h3=this.GetDisplayIndex(e5,h3);

    if (x5!=null&&typeof(x5)!="string")x5=new String(x5);

    var h6=this.GetCellFromRowCol(e5,h3,h5);

    if (this.ValidateCell(e5,h6,x5)){

    this.SetCellValueFromView(h6,x5);

    if (x5!=null){

    this.SetCellValue(e5,h6,""+x5,noEvent,recalc);

    }else {

    this.SetCellValue(e5,h6,"",noEvent,recalc);

    }

    this.SizeSpread(e5);

    }else {

    if (e5.getAttribute("lcidMsg")!=null)

    alert(e5.getAttribute("lcidMsg"));

    else

    alert("Can't set the data into the cell. The data type is not correct for the cell.");

    }

    }

     Can this hard-coded alert be customized? There is an ErrorMessage parameter for various CellType constructors, but it only seems to be used when cell value is changed in Edit mode, not when pasting clipboard data.

     Thanks,

     Stan

  •  07-01-2009, 12:41 PM 79739 in reply to 79696

    Re: lcidMsg

    Stan,

    When you paste data, the value does not get processed by the editor to validate as it does as you type in the cell and exit editmode. When you paste, the Setvalue method of Spread is used to put the data in the cell. As you see in the code, it calls a function to validate the data and if it fails, it displays this hardcoded message unless the lcidMsg attribute is set. This attribute is set by us if using the Japanese build of the Spread. However, you can set this attribute yourself in code by overriding the Render method of the page and using code like the following.

     Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
      FpSpread1.Attributes.Remove("lcidMsg")
      FpSpread1.Attributes.Add("lcidMsg", "Bad data...Translated")
      MyBase.Render(writer)
     End Su

     


    Scott S.
    Product Manager, Spread ASP.NET
    GrapeCity FarPoint
  •  07-03-2009, 9:14 AM 79821 in reply to 79739

    Re: lcidMsg

    Thanks Scott. That's exactly what I needed to know and it does the trick.

     Stan

View as RSS news feed in XML
     FarPoint Forums Home