Hello,
i have a radgrid bound to a list of complex objects. the binding on client side will not show the value of the complex property.
C# class:
Grid column:
Javascript:
The date and dosage properties will be shown but not the Agent.Name property. How can i achieve this?
Regards,
Dominic
i have a radgrid bound to a list of complex objects. the binding on client side will not show the value of the complex property.
C# class:
| public class BladderInstillation : BaseIdentifier |
| { |
| public DateTime Date { get; set; } |
| public decimal Dosage { get; set; } |
| public Agent Agent { get; set; } |
| } |
| public class Agent : BaseIdentifier |
| { |
| public string Name { get; set; } |
| public string AtcCode { get; set; } |
| } |
Grid column:
| <telerik:GridBoundColumn HeaderText="Agent" UniqueName="Agent" DataField="Agent.Name" /> |
Javascript:
| $.ajax({ |
| type: "POST", |
| url: "MyPage.aspx/Save", |
| data: "{'instillation' : " + Sys.Serialization.JavaScriptSerializer.serialize(instillation) + "}", |
| contentType: "application/json; charset=utf-8", |
| dataType: "json", |
| success: function(data) { |
| for (var i = 0; i < data.d.length; i++) { |
| data.d[i].Date = jsonParseDate(data.d[i].Date).format("dd.MM.yyyy"); |
| } |
| var tableView = $find("<%= radGrid.ClientID %>").get_masterTableView(); |
| tableView.set_dataSource(data.d); |
| tableView.dataBind(); |
| var grid = $find("<%= radGrid.ClientID %>"); |
| grid.repaint(); |
| } |
| }); |
The date and dosage properties will be shown but not the Agent.Name property. How can i achieve this?
Regards,
Dominic