0

経度と緯度を含むジオローカリゼーションに関する情報をDevXpressグリッドに表示します。両方の列は数値としてフォーマットされますが"N5"、緯度では45,xxxxであり、緯度では-73,xx生成されたコードとDevXpressを再確認しまし"WYSIWYG"たが、何も見つかりません。

生成されたコード:

// 
// colLatitude
// 
resources.ApplyResources(this.colLatitude, "colLatitude");
this.colLatitude.DisplayFormat.FormatString = "N5";
this.colLatitude.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.colLatitude.FieldName = "Latitude";
this.colLatitude.MinWidth = 50;
this.colLatitude.Name = "colLatitude";
this.colLatitude.OptionsColumn.AllowEdit = false;
this.colLatitude.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.colLatitude.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.colLatitude.OptionsColumn.ReadOnly = true;


// 
// colLongitude
// 
resources.ApplyResources(this.colLongitude, "colLongitude");
this.colLongitude.DisplayFormat.FormatString = "N5";
this.colLongitude.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
this.colLongitude.FieldName = "Longitude";
this.colLongitude.MinWidth = 50;
this.colLongitude.Name = "colLongitude";
this.colLongitude.OptionsColumn.AllowEdit = false;
this.colLongitude.OptionsColumn.AllowGroup = DevExpress.Utils.DefaultBoolean.False;
this.colLongitude.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
this.colLongitude.OptionsColumn.ReadOnly = true;

ビューのコントローラーからのコード:

 /// <summary>
 /// Get la Latitude
 /// </summary>
 public double Latitude
 {
   get { return this.GPSEventData.Latitude; }
 }
 /// <summary>
 /// Get la Longitude
 /// </summary>
 public double Longitude
 {
   get { return this.GPSEventData.Longitude; }
 }
4

1 に答える 1

1

グリッドは何らかの方法でデータソースにバインドされていると想定していますDataTable.

データソースのLatitudeとのタイプを確認してください。Longitudeそれらがstringグリッドの書式設定として定義されている場合、機能しません。

45,xxxx と -73,xx の値はカンマでフォーマットされているため、データソースで文字列として定義されている可能性があります。

実際にコンマを小数点として使用している場合は、ローカライズ設定に関係している可能性があります。この投稿を見てください:小数点区切り記号に問題があるアプリケーションを修正する方法

于 2013-03-14T21:37:27.043 に答える