Share via


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
<PersonalizableAttribute(PersonalizationScope.Shared)> _
<WebBrowsableAttribute(True)> _
<ResourcesAttribute("SearchResults_CRSelectColumns", "SearchResults_CRQueryOptions",  _
    "SearchResults_CRSelectColumns_ToolTip")> _
<PersistenceModeAttribute(PersistenceMode.InnerProperty)> _
Public Property SelectColumns As String
    Get
    Set
'Usage
Dim instance As CoreResultsWebPart
Dim value As String

value = instance.SelectColumns

instance.SelectColumns = value
[PersonalizableAttribute(PersonalizationScope.Shared)]
[WebBrowsableAttribute(true)]
[ResourcesAttribute("SearchResults_CRSelectColumns", "SearchResults_CRQueryOptions", 
    "SearchResults_CRSelectColumns_ToolTip")]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
public string SelectColumns { get; set; }

Property Value

Type: System.String
A string containing the XML specifying 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.

Example

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.

[C#]

…
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;
…

See Also

Reference

CoreResultsWebPart Class

CoreResultsWebPart Members

Microsoft.Office.Server.Search.WebControls Namespace