CoreResultsWebPart.SelectColumns property

Gets or sets the properties to return for the CoreResultsWebPart Web Part's search query.

Namespace:  Microsoft.Office.Server.Search.WebControls
Assembly:  Microsoft.Office.Server.Search (in Microsoft.Office.Server.Search.dll)

Syntax

'Declaration
<WebBrowsableAttribute(False)> _
<PersistenceModeAttribute(PersistenceMode.InnerProperty)> _
<PersonalizableAttribute(PersonalizationScope.Shared)> _
Public Property SelectColumns As String
    Get
    Set
'Usage
Dim instance As CoreResultsWebPart
Dim value As String

value = instance.SelectColumns

instance.SelectColumns = value
[WebBrowsableAttribute(false)]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[PersonalizableAttribute(PersonalizationScope.Shared)]
public string SelectColumns { get; set; }

Property value

Type: System.String
The string containing the XML that specifies the managed property names.

Remarks

You specify the managed property name in the Name attribute of the Column element. All the Column elements must be between the <Columns> and </Columns> tags.

The following example shows an XML string that specifies the CoreResultsWebPart query to return values for the Rank, Title, and custom property myCustomProperty managed properties in the search results.

…
using Microsoft.Office.Server.Search.WebControls;
…
CoreResultsWebPart coreResults = new CoreResultsWebPart();
string selectCol = @"<Columns><Column Name=""Rank""/><Column Name=""Title""/><Column Name=""myCustomProperty""/></Columns>";
coreResults.SelectColumns = selectCol;
…
Imports Microsoft.Office.Server.Search.WebControls

Dim coreResults As New CoreResultsWebPart()
Dim selectCol As String = "<Columns><Column Name=""Rank""/><Column Name=""Title""/><Column Name=""myCustomProperty""/></Columns>"
coreResults.SelectColumns = selectCol

See also

Reference

CoreResultsWebPart class

CoreResultsWebPart members

Microsoft.Office.Server.Search.WebControls namespace