the Grid demos state that conditional column formatting is not available when using ajax binding. I have a need for this and wondered if this was in the road map, and if so when it can be expected.
thanks for any information,
Patrick.
2 Answers, 1 is accepted
0
Atanas Korchev
Telerik team
answered on 24 Jun 2010, 04:41 PM
Hi Patrick Rubeski,
This is not in the roadmap nor will it ever be. The reason is simple - conditional server formatting code is executed on the server side whilst ajax binding occurs on the client side.
Fortunately a very simple workaround exists - use JavaScript to perform the formatting. To do so use the OnRowDataBound client event. Then use data from data item and style as appropriate. Here is a short example:
function onRowDataBound(e) {
var dataItem = e.dataItem;
var row = e.row;
if (dataItem.Freight > 100) {
row.cells[0].style.color = 'red';
}
}
I hope this helps,
Atanas Korchev
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
Atanas, thank you for the explanation. Can someone please update the online Custom Formatting page with this explanation and a link or demo for client side formatting. The way it's worded now makes it sound like you will support ajax binding formatting in the future, and it's not even possible to custom format at all yet. It will save others in the future some time to have the information from this post on the demo page. Thank you.