We recently upgraded to 2017.1 from 2015.2, and now the XamDataGrid is ignoring newline characters in the text strings we're putting in the cells.
If we have the following text string: "first line\r\n second line\r\n third line\r\n fourth line", when the text is displayed it looks like this:
"first line
second line third line fourth line"
Nothing in our code has changed. It's only after the upgrade to 2017.1 that we see this behavior.
Hello Chris,
I have been investigating the issue that you are referring to in this case, and I have put together a sample XamDataGrid with a text field with the text of "first line\r\n second line\r\n third line\r\n fourth line." In doing so, I cannot seem to reproduce the behavior you are seeing, as the text appears to wrap normally on my end.
I have attached the sample project I used to test this. Please test this project on your PC; whether or not it works correctly may help indicate the nature of this problem. As you had mentioned you have upgraded to 17.1, I have tested against the latest version of 17.1 (17.1.20171.2200).
If the project does not work correctly, this indicates either a problem possibly specific to your environment, or a difference in the DLL versions we are using.
If the project does show the product feature working correctly, this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
Or, if this sample project is not an accurate demonstration of what you're trying to do, please feel free to modify it and send it back, or send a small sample project of your own if you have one.
Please let me know if you have any other questions or concerns on this matter.
XDGNewLineIssueTest.zip
We are using version 17.1.20171.2073 in our application.
I have modified the sample project that I had originally sent you to use version 17.1.20171.2073 of the Infragistics for WPF assemblies, and I am still unable to reproduce the behavior you are seeing. Are you able to see the behavior you have described when running the sample project I had sent you against this version? If so, this may point at an issue specific to our environment.
If not, then this indicates a possible problem in the code of your application. It will help if you can provide a small, isolated sample application that demonstrates the behavior you are seeing.
I've attached a sample application that I created by extracting portions of our code. I've done some digging and discovered that the issue presents itself when we set the CellMaxHeight of the cell in question. If I remove that code, then the text displays properly, respecting the newline characters.
If you look at ReportView.ResizeFieldLayout() you can see where we set the CellMaxHeight of the 'Comment' field. Removing this code eliminates the issue, but doesn't allow us to limit the height of the cell, which we need to do. Can you have a look and advise?
2625.WpfApp1.zip
I have been investigating the sample project you sent, and I have reproduced the behavior you are seeing. This issue appears to be due to a bug that existed in version 17.1.20171.2073 in which the underlying SimpleTextblock inside of the CellValuePresenter was being forced to be the same height of the cell if the CellMaxHeight was set. This essentially disallowed any vertical overflow in the cell due to text wrapping, and it would override the newline characters to show them inline.
This behavior is resolved in version 17.1.20171.2200, which was the latest and final service release for version 2017.1. As this behavior is resolved, I would recommend that you upgrade to this version of the service release to resolve this issue. You can do this by following the steps below:
1. View My Keys and Downloads: https://www.infragistics.com/my-account/keys-and-downloads2. Log in to the Infragistics web site if you are not already logged in.3. Select the product you would like to download a service release for.4. Select the “Service Releases” tab.5. Select the download (e.g. Infragistics WPF 2017.1 - Service Release)