New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

Definition

Namespace:Telerik.Web.UI

Assembly:Telerik.Web.UI.dll

Syntax:

C#
public class SearchContext : IDisposable

Inheritance: objectSearchContext

Implements: IDisposable

Inherited Members object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()object.GetType()object.MemberwiseClone()...

Constructors

C#
public SearchContext()

Properties

Gets or sets the css class of the search context element.

C#
public string CssClass { get; set; }
Property Value:

The search context CSS class.

Gets or sets the DataKeyField.

C#
public virtual string DataKeyField { get; set; }
Property Value:

The DataKeyField.

Gets or sets the ID of the Model from the ODataDataSource control used for data binding.

C#
public virtual string DataModelID { get; set; }

Gets or Sets the DataSource of the SearchContext for the RadSearchBox control.

C#
public object DataSource { get; set; }

Gets or Sets the ID of the DataSource control of the SearchContext for the RadSearchBox control.

C#
public string DataSourceID { get; set; }

Gets or sets the DataTextField.

C#
public virtual string DataTextField { get; set; }
Property Value:

The DataTextField.

Gets or sets the css class of the dropdown.

C#
public string DropDownCssClass { get; set; }
Property Value:

The dropdown CSS class.

Gets or sets whether the SearchContext is enabled.

C#
public virtual bool Enabled { get; set; }

The default value is zero.

Gets the RadSearchBox SearchContextItemCollection.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public SearchContextItemCollection Items { get; }

Gets or sets a value indicating the client-side event handler that is called after a SearchContextItem is bound to a dataItem as a result of a client-side binding to RadODataDataSource control

C#
public string OnClientItemDataBound { get; set; }
Property Value:

A string specifying the name of the JavaScript function that will handle the event. The default value is empty string.

If specified, the OnClientItemDataBound client-side event handler is called after a SearchContextItem is bound to a dataItem as a result of a client-side binding to RadODataDataSource control.

The event handler receives two parameters: the instance of the searchBox context client-side object and event args

This event cannot be cancelled.

Gets or sets a value indicating the client-side event handler that is called after a SearchContextItem is selected

C#
public string OnClientItemSelected { get; set; }
Property Value:

A string specifying the name of the JavaScript function that will handle the event. The default value is empty string.

If specified, the OnClientItemSelected client-side event handler is called after a SearchContextItem is selected.

The event handler receives two parameters: the instance of the searchBox context client-side object and event args

This event cannot be cancelled.

Gets or sets the selected index of the SearchContext control.

C#
[Bindable(true)]
[Browsable(false)]
public int SelectedIndex { get; set; }
Property Value:

The index that should be selected.

Set the selected index to -1 to clear the selection.

Gets the currently selected item in the searchContext.

C#
[Bindable(false)]
[Browsable(false)]
public virtual SearchContextItem SelectedItem { get; }

SelectedItem can be null in client-side binding scenarios.

Gets or sets whether the DefaultItem should be shown.

C#
public virtual bool ShowDefaultItem { get; set; }

By default it is shown and if no item is selected it is the selected one.

Gets or sets the TabIndex of the SearchContext control.

C#
public virtual short TabIndex { get; set; }

The default value is zero.

Gets the settings for the web service used to provide SearchContext items.

C#
[PersistenceMode(PersistenceMode.InnerProperty)]
public WebServiceSettings WebServiceSettings { get; }
Property Value:

An WebServiceSettings that represents the web service used to provide search results.

Gets or sets the width of the SearchContext's input area.

C#
[TypeConverter(typeof(UnitConverter))]
public Unit Width { get; set; }
Property Value:

The width of the SearchContext's input area.

Methods

Clears the selection. The Selected property of all items is set to false.

C#
public void ClearSelection()
C#
public void DataBind()
C#
[SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
public void Dispose()

Implements: IDisposable.Dispose()

C#
protected virtual void Dispose(bool disposing)
Parameters:disposingbool

Events

Occurs after a context item is data bound to the RadSearchBox control.

C#
public event SearchBoxContextItemEventHandler ItemDataBound

This event provides you with the last opportunity to access the data item before it is displayed on the client. After this event is raised, the data item is nulled out and no longer available.