The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientComboBox.PerformCallback(parameter) Method

Sends a callback to the server and generates the server-side ASPxAutoCompleteBoxBase.Callback event, passing it the specified argument.

Declaration

PerformCallback(parameter: string): void

Parameters

Name Type Description
parameter string

A string value that represents any information that needs to be sent to the server-side ASPxAutoCompleteBoxBase.Callback event.

Remarks

Use the PerformCallback method to update the control's item collection. When you call the PerformCallback method, the control clears its item collection and a control value on the client side and sends a postback to the server. The server side returns the actual item collection and control selection. Note that the combo box's structure cannot be changed during a callback.

You can also use the PerformCallback method if you need to asynchronously go to the server and perform server-side processing using AJAX-based callback technology. You can pass the required information to the client side as a string of arguments (for instance, in the "Name = Value;" form) using the PerformCallback method's parameter parameter.

The PerformCallback method posts back to the server using callback technology, and generates a server-side ASPxAutoCompleteBoxBase.Callback event. The method's parameter argument is passed to the ASPxAutoCompleteBoxBase.Callback event's handler as the CallbackEventArgsBase.Parameter property. So, the necessary server-side actions can be performed in the event's handler based upon the values of the arguments, obtained by parsing the passed information string.

Note

When the control initiates a callback using the PerformCallback method with parameters, subsequent internal callbacks (items filtering, loading, etc.) raise the server-side ASPxAutoCompleteBoxBase.Callback event with the parameters passed to the PerformCallback method previously. This allows you to use the PerformCallback method to bind the control to the new item collection without losing parameters initially passed to this method.

The ASPxAutoCompleteBoxBase.Callbackevent handler allows changing the control's value/selection only on a callback caused by the PerformCallback method. If the event is caused by internal callbacks (loading items on scrolling / items filtering), the control stops selection changes.

The ASPxClientComboBox.BeginCallback and ASPxClientComboBox.EndCallback client events can also be used to perform necessary client actions before and after callback processing.

Example

The following example illustrates how to use the PerformCallback method.

WebForms approach:

Note

For a full example, see the ASPxComboBox - Cascading Combo Boxes demo.


<dx:ASPxComboBox runat="server" ID="CmbCountry" DropDownStyle="DropDownList" IncrementalFilteringMode="StartsWith"
    TextField="CountryName" ValueField="CountryName" Width="100%" DataSourceID="CountriesDataSource"
    EnableSynchronization="False">
    <ClientSideEvents SelectedIndexChanged="function(s, e) { OnCountryChanged(s); }" />
</dx:ASPxComboBox>

MVC approach:

The PerformCallback method has an MVC-related equivalent. Refer to the MVCxClientComboBox.PerformCallback method for more information.

Note

For a full example, refer to MVC ComboBox Extension - Cascading Combo Boxes.


@Html.DevExpress().ComboBox(settings => {
    settings.Name = "City";
    settings.Properties.TextField = "Name";
    settings.Properties.ValueField = "ID";
    ...
    settings.Properties.ClientSideEvents.BeginCallback = "function(s, e) { e.customArgs['Country'] = Country.GetValue(); }";
}).BindList(CS.Models.City.GetCities(Model.Country)).Bind(Model.City).GetHtml()
...
@Html.DevExpress().ComboBox(settings => {
    settings.Name = "Country";
    settings.Properties.TextField = "Name";
    settings.Properties.ValueField = "ID";
    ...
    settings.Properties.ClientSideEvents.SelectedIndexChanged = "function(s, e) { City.PerformCallback(); }";
}).BindList(CS.Models.Country.GetCountries()).Bind(Model.Country).GetHtml()  
See Also