Export (0) Print
Expand All

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)

[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.

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

Community Additions

ADD
Show:
© 2014 Microsoft