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

[Solved] SortedBackColor with client-side data binding

1 Answer 85 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jormo josh
Top achievements
Rank 1
jormo josh asked on 29 Jan 2010, 05:49 AM
I'm using Q3 2009 SP2

Does SortedBackColor (in SortingSettings) work with client-side data binding using GetBindingData() ?  I'm using GetBindingData() in a web service, and all works great including sorting the data, but I can't get SortedBackColor to work.  If this property is not available with client-side databinding, is there another way to do it?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 03 Feb 2010, 02:57 PM
Hello Jormo,

When the RadGrid is bound  via client-side binding it transfers JSON from client-to-server-to-client in order to bind/page/sort/filter on the client. So you could not change its style when the sorting is performed. The JSON does not keep any data for the RadGrid visual appearance it only keeps the actual data of the RadGrid.
A possible workaround is to change the background color of the column manually via JavaScript into the client side OnCommand event.

<ClientSettings>
    <ClientEvents OnCommand="OnCommand" />
</ClientSettings>


 In OnCommand event handler you could check out if the command name is "Sort" and if it is you could apply custom style to all cells in the column by which the RadGrid is sorted.

function OnCommand (sender, args) {
  if(args.get_commandName() == "Sort")
  {
    // Change the background color.
     ...
  }
}

I hope this helps.

Greetings,
Radoslav
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Grid
Asked by
jormo josh
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or