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)> _
<PersistenceModeAttribute(PersistenceMode.InnerProperty)> _
<WebBrowsableAttribute(False)> _
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)]
[PersistenceModeAttribute(PersistenceMode.InnerProperty)]
[WebBrowsableAttribute(false)]
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