I can't figure this out. I have the results of a linq query and want to display them in a table.
This is what the controller returns:
return View(new GridModel<XElement> { Data = ci });This is what is in the view:
@{ ViewBag.Title = "Home Page";}<h2>@ViewBag.Message</h2>@model IEnumerable<System.Xml.Linq.XElement>@{Html.Telerik().Grid(Model) .Name("Issues") .Columns(cols => { cols.Bound(c => c.Attribute("Issue").Value).Template( @<text>Attribute("Issue").Value</text> ); }) .DataBinding(db => db.Ajax().Select("_ClientLoading", "Home").OperationMode(GridOperationMode.Client)) .Filterable() .Sortable() .Groupable() .Render(); }5 Answers, 1 is accepted
What is the problem which you are currently facing? I couldn't understand that from what you have posted. Please elaborate.
All the best,Atanas Korchev
the Telerik team
Do you have any existing examples of using XElements? Doesn't seem like I should need to re-invent the wheel for something that's been done before.
No, we currently don't have any existing examples for binding to XElements. Could you check the server response when server error 500 is shown? You can use a HTTP sniffer tool such as Fiddler or Firebug to do this. In that response the full stack trace of the exception would be shown. I suspect that JSON serialization of XElement is not supported by ASP.NET MVC hence the exception.
Regards,Atanas Korchev
the Telerik team
Telerik Grid for ASP.NET MVC does not support binding to raw XML data. You also cannot add rows on the client side.
Regards,Atanas Korchev
the Telerik team