SearchContext
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
public class SearchContext : IDisposable
Inheritance: objectSearchContext
Implements:
Inherited Members
Constructors
public SearchContext()
Properties
Gets or sets the css class of the search context element.
public string CssClass { get; set; }
The search context CSS class.
Gets or sets the DataKeyField.
public virtual string DataKeyField { get; set; }
The DataKeyField.
Gets or sets the ID of the Model from the ODataDataSource control used for data binding.
public virtual string DataModelID { get; set; }
Gets or Sets the DataSource of the SearchContext for the RadSearchBox control.
public object DataSource { get; set; }
Gets or Sets the ID of the DataSource control of the SearchContext for the RadSearchBox control.
public string DataSourceID { get; set; }
Gets or sets the DataTextField.
public virtual string DataTextField { get; set; }
The DataTextField.
Gets or sets the css class of the dropdown.
public string DropDownCssClass { get; set; }
The dropdown CSS class.
Gets or sets whether the SearchContext is enabled.
public virtual bool Enabled { get; set; }
The default value is zero.
Gets the RadSearchBox SearchContextItemCollection.
[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
public string OnClientItemDataBound { get; set; }
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
public string OnClientItemSelected { get; set; }
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.
[Bindable(true)]
[Browsable(false)]
public int SelectedIndex { get; set; }
The index that should be selected.
Set the selected index to -1 to clear the selection.
Gets the currently selected item in the searchContext.
[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.
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.
public virtual short TabIndex { get; set; }
The default value is zero.
Gets the settings for the web service used to provide SearchContext items.
[PersistenceMode(PersistenceMode.InnerProperty)]
public WebServiceSettings WebServiceSettings { get; }
An WebServiceSettings that represents the web service used to provide search results.
Methods
Clears the selection. The Selected property of all items is set to false.
public void ClearSelection()
public void DataBind()
[SuppressMessage("Microsoft.Design", "CA1063:ImplementIDisposableCorrectly")]
public void Dispose()
Implements:
Events
Occurs after a context item is data bound to the RadSearchBox control.
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.