This is a migrated thread and some comments may be shown as answers.

RadGrid not showing Sql Server table's XML type field data

1 Answer 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nishant
Top achievements
Rank 1
Nishant asked on 20 Mar 2013, 12:24 AM
ASP.NET AJAX Q1,2013, Visual Studio 2010 Ultimate SP1, IE 9, SQL Server 2008 R2

I have a RadGrid (AutoGenerateColumns=True) bound to an SQL Server table containing multiple columns. The grid does not show values of columns that are of XML data type !

Is this feature unsupported or I see a bug here ?

I also tried to cast the xml type column into varchar(max), but it still does not show anything. The same query works fine in the SQL Server management studio with or without the CAST.

Nishant

1 Answer, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 22 Mar 2013, 03:55 PM
Hi,

 This is most likely because you are showing pure XML in the grid's cells which is interpreted by the browser as HTML tags and not as text data. You need to use HtmlEncode to encode the cell's text (for example in ItemDataBound event of the grid) before showing it in the browser.

All the best,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Nishant
Top achievements
Rank 1
Answers by
Marin
Telerik team
Share this question
or