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

Add RadAjax Manager to only Sort Command on RadGrid

1 Answer 28 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Aret asked on 02 Aug 2012, 12:10 PM
Hi, I was wondering if there was a way to add the radajaxmanager specifically to the sort command of a radgrid.  I am pretty sure this has to be done pro grammatically using or C#.  For example here is an example where I specifically added the radajax functionality to a LinkButton control within a radgrid programmatically using

 Protected Sub Radgrid_AddRemoveProvider_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Radgrid_AddRemoveProvider.PreRender
       For Each item As GridDataItem In Radgrid_AddRemoveProvider.MasterTableView.Items
            Dim btnAddProvider As LinkButton = DirectCast(item.FindControl("btnAddProvider"), LinkButton)
            Dim btnRemoveProvider As LinkButton = DirectCast(item.FindControl("btnRemoveProvider"), LinkButton)

            'Add radajax functionality to only specific controls within radgrid
            radAjaxManager1.AjaxSettings.AddAjaxSetting(btnAddProvider, Radgrid_AddRemoveProvider)
            radAjaxManager1.AjaxSettings.AddAjaxSetting(btnRemoveProvider, Radgrid_AddRemoveProvider)

End Sub

Since the 'Sorting' within a radgrid is not a control, I do not know how to add it to the ajaxmanager.  Please Assist...

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 03 Aug 2012, 01:15 PM
Hello Aret,

You could enable ajax only on sorting command using the following approach:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="requestStart">
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" />

function requestStart(sender, args) {
    if (args.get_eventArgument().indexOf("Sort") < 0)

That should do the trick.

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.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question