简体   繁体   English

Dynamics CRM 4 SDK中的换行符

[英]dynamics crm 4 newlines in sdk

I have several multi-line text fields in an entity in CRM 4. When I load the value from one into a multi-line Windows.Forms.Textbox in C# through the SDK using something like 我在CRM 4的一个实体中有几个多行文本字段。当我使用类似的东西通过SDK将值从一个值加载到C#中的多行Windows.Forms.Textbox中时。

this.textBox.Text = myOpportunity.new_detail.ToString();

the newline characters aren't transferred properly. 换行符未正确传输。 They show up as small squares in my C# form field. 它们在我的C#表单字段中显示为小方块。

How can I convert these properly in both directions (Fetch and Update)? 如何在两个方向(获取和更新)正确转换它们?

I suspect they're coming through as just line feed (\\n) instead of carriage return line feed (\\r\\n). 我怀疑它们只是换行(\\ n)而不是回车换行(\\ r \\ n)。

You can probably just do a simple replace: 您可能可以做一个简单的替换:

this.textBox.Text = myOpportunity.new_detail.ToString().Replace("\n", "\r\n");

and then the reverse in the opposite direction. 然后反方向相反。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM