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

RadGrid, OData Web Service and client templates

1 Answer 38 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christophla
Top achievements
Rank 1
Christophla asked on 04 Dec 2012, 08:16 PM
We are using a WCF service to databind our grid client-side. Certain rows need to be a different color based on the data returned from the service.

At first, I attempted using a GridTemplateColumn to bind with a <div class='<%# Eval("ClassName") %>'><%# Eval("Title") %></div> to swap colors, but quickly realized that the DataBinder is a server-side capability.

Is there a way to either a) do a client-side template column with databinding or b) handle the javascript OnDataItemBound?

Christopher

1 Answer, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 07 Dec 2012, 08:22 AM
Hello Christopher,

In order to achieve your scenario you could use the RowDataBound client-side event and programatically set the className. Another possible solution is to use the ClientItemTemplate functionality shown in the demo below and described here.

Regards,
Antonio Stoilkov
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
Christophla
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Share this question
or