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

SubObjects (MetaFields + MetaKey) not displayed on client-binding

2 Answers 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
OLIVER
Top achievements
Rank 1
OLIVER asked on 14 Oct 2010, 09:17 PM
Hi there,

I really like the telerik ajax tools, but I have a slight problem now: the property value of a subobject is not displayed in the grid: Status.Shortcut. Pasting the json code (extracted by fiddler2) into a json viewser, looks ok.

Telerik-Version: v.2010.2.929.35

Even when creating a client side array, it doesn't display subobject's values.

Alerting the field says: ok - is there.


WHAT CAN I DO? Please help.

Thank you very much.

Client-Side DataBinding:
function UpdateGrid(rows) {
            clearError();
            var grid = $find("<%=gridTickets.ClientID %>");
            var mtv = grid.get_masterTableView();
  
            alert(rows[0].Status.Shortcut); //  <--WORKS GREAT!!!!
  
            mtv.set_dataSource(rows);
            mtv.dataBind();
            return;
        }


Page.aspx:
<telerik:RadGrid ID="gridTickets" runat="server" >
    <MasterTableView DataKeyNames="Id">
        <Columns>
            <telerik:GridBoundColumn DataField="Id" HeaderText="Id" Display="false" />
            <telerik:GridBoundColumn DataField="Status.Shortcut" HeaderText="Status" />
            <telerik:GridBoundColumn DataField="Subject" HeaderText="Betreff" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


The JSONed Data

{
  "d": [
    {
      "__type": "Ticket:#TicketWeb.Entities",
      "Area": {
        "__type": "TicketArea:#TicketWeb.Entities",
        "Id": 0,
        "Name": "test",
        "Shortcut": "test"
      },
      "AreaId": 0,
      "Comments": null,
      "CostCenter": null,
      "CostCenterId": 0,
      "Created": "\/Date(1287085525987+0200)\/",
      "DontSendMailsAtInsert": false,
      "DueDate": null,
      "Duration": 0,
      "FinishDate": null,
      "From": null,
      "FromId": 0,
      "Guid": "6d9ac3f8-2bd4-4338-83cc-e85375e90039",
      "Id": 0,
      "InCharge": null,
      "InChargeId": 0,
      "LegacyId": null,
      "LegacyUid": null,
      "Logs": null,
      "ParentTicket": null,
      "ParentTicketId": 0,
      "PercentFinished": 0,
      "PhoneNumber": null,
      "Priorities": [
        {
          "__type": "Priority:#TicketWeb.Entities",
          "Value": 0
        },
        {
          "__type": "Priority:#TicketWeb.Entities",
          "Value": 1
        },
        {
          "__type": "Priority:#TicketWeb.Entities",
          "Value": 2
        },
        {
          "__type": "Priority:#TicketWeb.Entities",
          "Value": 3
        }
      ],
      "Priority": 0,
      "Reason": null,
      "ReceivedDate": null,
      "Responsible": null,
      "ResponsibleId": 0,
      "Revision": 0,
      "SortIndex": 0,
      "Specification": null,
      "StartDate": null,
      "Status": {
        "__type": "Status:#TicketWeb.Entities",
        "Id": 0,
        "MarksFinish": false,
        "MarksStart": false,
        "MarksStatusForNewSubProjects": false,
        "Name": "testkaka",
        "SetForNewTickets": false,
        "Shortcut": "kakakka",
        "SortIndex": 0
      },
      "StatusId": 0,
      "SubProjects": null,
      "Subject": "HI",
      "TicketReasonId": 0,
      "TicketType": null,
      "TicketTypeId": null,
      "TypeOfCosts": null,
      "TypeOfCostsId": 0
    }
  ]
}

2 Answers, 1 is accepted

Sort by
0
OLIVER
Top achievements
Rank 1
answered on 18 Oct 2010, 08:34 AM
Anybody?
0
Nikolay Rusev
Telerik team
answered on 21 Oct 2010, 07:32 AM
Hello OLIVER,

I am afraid that RadGrid does not support client-side binding of nested properties. You can try handling OnRowDataBound event and populate the cells manually.

Best wishes,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
OLIVER
Top achievements
Rank 1
Answers by
OLIVER
Top achievements
Rank 1
Nikolay Rusev
Telerik team
Share this question
or