[DevExpress Support Team: CLONED FROM DQ8006: saving grid xml layout to SQL database]
Hello Sasha
I am working in WPF with GridControl, Devexpress 14.2.6
I was trying to save my gridcontrol layout in my database with datatype XML but I have a serialization exception.
I use the code that I posted, is that the correct way to do that? I just want to save my layout in my database.
Thank you
How to save Grid's layout to a database
Answers approved by DevExpress Support
Hi Osmani,
DXGrid provides the SaveLayoutToXML()/SaveLayoutToStream() and RestoreLayoutFromXML()/RestoreLayoutFromStream() methods allow saving/restoring the grid layout. You don't need to use DXSerializer to do so. For more information, see Saving and Restoring Layout.
Let me know your results.
Yes I know but it is not allows me save the xml in the database. That's why I submit the ticket.
I was playing around with the control like a week and I am not able to save as XML in my database.
Hi Osmani,
Since this issue is not directly related to our controls but mostly to parameterized SQL queries, I am not sure that I can provide you with a precise solution. It would be better if you address your inquiry to MSDN Forum.
Here my thoughts regarding this issue.
If you don't plan performing XML-specific operations with a stored layout at the database level, I think it is better to use one of generic SQL types for compatibility reasons (such as nvarchar) to store data instead of using the MS SQL-specific XML type. I have prepared a small sample for your reference. See the attachment.