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

Client-side binding on radgrid works incorrectly for field names, that contain *Name* in it

4 Answers 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 30 Mar 2011, 12:56 PM

Once again  I cannot remember how i managed to submit support ticket, it's not obvious from the interface.. :(

So, I post a problem here.
Please, confirm if this is already fixed in the newest version of Telerik Controls otherwise would be great, if you fixed this ASAP...

If I use client-side binding and have two labels, responsible for displaying some entity fields within GridTemplateColumn and one of them corresponds to field "Name" - then another one, if it contains word "Name" in it, ignores field value and instead also shows "Name" field value! :(

<telerik:GridTemplateColumn HeaderStyle-CssClass='GridHeaderGreen la' ItemStyle-CssClass='la'
    HeaderText="Model" SortExpression="SVC2.CLUSTER_STATE.NAME">
    <itemtemplate>
        <asp:Label ID="Name" runat="server" />
    </itemtemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderStyle-CssClass='GridHeaderGreen la' ItemStyle-CssClass='la'
    HeaderText="Group Name" SortExpression="SVC2.CLUSTER_STATE.GROUPNAME">
    <itemtemplate>
        <asp:Label ID="GroupName" runat="server" />
    </itemtemplate>
</telerik:GridTemplateColumn>

In the given case grid shows "Name" value in first and second columns! It ignores "GroupName" value, even though json data is correct!

4 Answers, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 04 Apr 2011, 03:36 PM
Hello Alexander,

I tried to replicate the issue which you described, but to no avail.
Attached to this message, you will find the code which I used for testing.

Please, take a look at it and let me know if there are any differences at your end, which I may be leaving out.

Best wishes,
Mira
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
0
Alexander
Top achievements
Rank 1
answered on 05 Apr 2011, 12:36 PM
Hi! Sorry, i have not seen attached project, because i am ready to send the demo where bug is reproduceable.
Demo

So, if you have json object, where, for instance, you have some field - ContactName, that alphabetically is 'less', than Name and it stands before Name - such field is displayed incorrectly. If you have the field ZName, that stands after - it shown as expected. You can add order = [number] to DataMember attribute in GridEntity.cs to change the order of fields and then the bug goes away.
0
Mira
Telerik team
answered on 08 Apr 2011, 11:43 AM
Hello Alexander,

Thank you for the additional information.

The described behavior is indeed a limitation of the RadGrid with client-binding.
It can be easily overcome with the approach demonstrated in the sample project attached to this post.

I hope it helps.

Best wishes,
Mira
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
0
Jesper Matthiesen
Top achievements
Rank 1
answered on 08 Apr 2011, 12:10 PM
Hi,

thanks, that's exactly how we solved this issue. We also can use order attribute to change the sequence of following of properties in json object.

So it's not a big deal, but would be nice if it was resolved in some next RadControl releases!
Tags
Grid
Asked by
Alexander
Top achievements
Rank 1
Answers by
Mira
Telerik team
Alexander
Top achievements
Rank 1
Jesper Matthiesen
Top achievements
Rank 1
Share this question
or