I have a column in my grid that contains an embedded HTML table. Works great, looks just like I want it.
I have a problem, however, when trying to update data on the grid (sending to server with SaveChanges). When data is sent to the server, the table gets sent too and I get an error when trying to read the transaction from the response ("A potentially dangerous Request.Form value was detected..."). I understand why I'm getting the error, I'm sending embedded HTML in my request.
My question is, is there any way that I can NOT send that particular column when I post an update? I don't need that column in the update set (it's read-only and I don't need it at the server) but I can't see any way of not sending that particular column or otherwise not sending the embedded HTML. I tried an unbound column, I tried the "mapping" option on the column, neither work, the column with the HTML table still gets sent and there doesn't seem to be any way for me to "escape" the embedded HTML to avoid the issue.
Turning off the warning is not an option, and I'm wondering if there's any other solution short of manually serializing and sending the data?
This is in version 17.1
Thank you.
Attached is a pared down sample if what I'm trying to accomplish.
There are two scenarios here, a user may update and save one or more individual rows, or user may tick checkbox in column to tag *all* the rows for acknowledgement or exclusion.("ACK" = "acknowledge", "EXC" = "exclude"). I added a checkbox to the grid column header to allow the ACK/EXC all.
I'm manually futzing with the transactions in both the "checkAll" and "saveChanges" functions because that seemed to be the only way for me to get a consistent shape of the transaction data on the server side depending on what the user does. Just editing the checkbox in the cell and sending that gave me a "cell" transaction instead of a "row" transaction, for instance, whereas editing individual rows sent "row" transactions. With what I've done here, I get a consistent shape from the grid transactions whether the transactions are from the "check all" or from editing individual rows, and I don't have to try to parse it all out on the server (it actually doesn't send transactions wrapped in "row", e.g., it just sends the row data, much simpler).
this also strips out the embedded HTML table in the transaction, which is what I was really asking about...is there any other way, with existing functionality, to NOT send that column with the embedded table?
Thanks.
Hello Doug,
Thank you for the update that you found your code working.
I am not very sure if you can achieve the requirement without sending the column at all.
I would like to know how you set up your code and instantiate the grid.
Would be helpful if you could provide me a small isolated sample to investigate the scenario further.
Well, I think I sort-of answered my question. I'm already handling saving manually, and on save I can iterate the transaction log from the grid and "null out" the offending column on each transaction row. A subsequent call to "SaveChanges" then works, I can receive and parse the response on the server without error.
So that seems to work OK for this situation. I'm still wondering if there's any way to just not send that column at all? That would be preferable but this'll work for now.