I have the following code in a WebHierarchicalDataGrid's InitializeRow event in order to format html links when I don't know if or where they will be in the datatable. It's been working great for years, but within the last year something has broken, and it no longer formats the first row. All other rows are formatted fine. I can't know for sure which version this first popped up in, but I know it exists in 12.2.20142.2146.
If e.Row.Items.Count > 0 Then
For i As Integer = 0 To e.Row.Items.Count - 1
If e.Row.Items(i).Text.ToLower.Contains("href=") Then
Dim oColumn As BoundDataField = CType(e.Row.Items(i).Column, BoundDataField)
oColumn.HtmlEncode = False
oColumn.CssClass = "nowrapHTML"
End If
Next
Hello Clinton,
I am still following up. Have you been able to resolve the issue?If you have any concerns or questions, please feel free to contact me, I will be glad to help you.Thank you for choosing Infragistics components!
Thank you for your patience!
I have modified your sample with workaround to fix the first row.
To workaround this, you can get the text of the celll and set it as html, using jQuery.
Let me know If I you need further assistance.
Yes, as I said in my second post, I understand that. Look at the output. The issue isn't that the event is not firing like I assumed it is. The event is firing, but in the first row, the HtmlEncode isn't working properly. The first row shows the HTML encoded, and thus looks like the raw HTML, all the other rows display non-encoded HTML, and thus the links as intended.
I am not able to see the result the event is fired 4 time exactly the same amount as the rows are.
I have modified the sample so it prints the record it for which it is being fired.
I have tested this in Chrome, Firefox and IE 8-11.
Please let me know if I am missing anything else for reproducing the issue.
Sorry, I missed your earlier post.
I can understand the cross scripting concern. This app displays reports written in sql on our customer portal, and allows them to be added/modified without the need to modify code. We've had this app in production for years, and it was the primary reason for purchasing Infragistics controls back in 2007, and continuing to renew each year. Some of the reports in questions contain links to other reports in the same customer portal, and we are in control of every report, so xss is not a concern for us. There are well over 400 reports in production, though only a fraction utilize this href feature.
Please keep in mind that this has worked fine for us since switching to the WebHierarchicalDataGrid when the original WebGrid was discontinued several years ago, and I believe the code itself was from an old Infragistics post or documentation. Even now this method works great for every row EXCEPT the first row, so is obviously a bug that was introduced in one of the last few versions.
I have attached an example project which demonstrates the issue. It's based on your original project with some minor changes and reproduced the problem reliably.