Microsoft.SharePoint.WebCon ...


TableResultControl Class (Microsoft.SharePoint.WebControls)

Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Syntax

Visual Basic (Declaration)
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
Public NotInheritable Class TableResultControl
    Inherits PickerResultControlBase
Visual Basic (Usage)
Dim instance As TableResultControl
C#
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public sealed class TableResultControl : PickerResultControlBase
Inheritance Hierarchy

System.Object
   System.Web.UI.Control
     System.Web.UI.TemplateControl
       System.Web.UI.UserControl
         Microsoft.SharePoint.WebControls.PickerResultControlBase
          Microsoft.SharePoint.WebControls.TableResultControl
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also

Tags :


Community Content

Adam Buenz - MVP
TableResultControl

Description

The Microsoft.SharePoint.WebControls.TableResultControl class inherits from the Microsoft.SharePoint.WebControls.PickerResultControlBase class which provides functionality for EntityEditorWithPicker contsruction facilitating the searching of arbitrary data. Class heavily related to the use of this control are the Microsoft.SharePoint.WebControls.EntityEditorWithPicker class, the Microsoft.SharePoint.WebControls.PickerDialog class, and Microsoft.SharePoint.WebControls.SimpleQueryControl class.

TableResultControl functions by using a series of System.Collections.ArrayList properties, namely:

ColumnDisplayNames
ColumnNames
ColumnWidths

to produce a System.Web.UI.WebControls.Table object that can contains the results of a data query used with a PickerDialog.ResultControl.

Usage Scenario

The primary usage of TableResultControl is to provide strongly typed Table generation include formatting for classes that inherit from PickerDialog. When a class is inheriting from PickerDialog, new ArrayList object can be created within the class constructor by casting a TableResultControl type against the PickerDialog.ResultControl, allowing exposure of the described properties.

In the below example, the MyPickerDialog class is inheriting from the PickerDialog class. MyPickerDialog contains a parameterless constructor, however is calling the base constructor passing in a custom MyEntityEditor object which inherits from the EntityEditorWithPicker class and a custom MyCustomQueryControl object which inherits from the SimpleQueryControl class. Following, in the MyPickerDialog constructor, we are building the relevant ArrayList objects for the custom PickerDialog to use by casting with the TableResultControl type against the PickerDialog.ResultControl, allowing the required values to be exposed via their properties.

C# Code Example

public class MyPickerDialog : PickerDialog
{
public MyPickerDialog() : base(new MyCustomQueryControl(), new TableResultControl(), new MyEntityEditor())
{
ArrayList columnDisplayNames = ((TableResultControl)base.ResultControl).ColumnDisplayNames;
columnDisplayNames.Clear();
columnDisplayNames.Add("Name");
ArrayList columnNames = ((TableResultControl)base.ResultControl).ColumnNames;
columnNames.Clear();
columnNames.Add("Name");
ArrayList columnWidths = ((TableResultControl)base.ResultControl).ColumnWidths;
columnWidths.Clear();
columnWidths.Add("100%");
}
}

VB.NET Code Example

Public Class MyPickerDialog
Inherits PickerDialog
Public Sub New()
MyBase.New(New MyCustomQueryControl(), New TableResultControl(), New MyEntityEditor())
Dim columnDisplayNames As ArrayList = DirectCast(MyBase.ResultControl, TableResultControl).ColumnDisplayNames
columnDisplayNames.Clear()
columnDisplayNames.Add("Name")
Dim columnNames As ArrayList = DirectCast(MyBase.ResultControl, TableResultControl).ColumnNames
columnNames.Clear()
columnNames.Add("Name")
Dim columnWidths As ArrayList = DirectCast(MyBase.ResultControl, TableResultControl).ColumnWidths
columnWidths.Clear()
columnWidths.Add("100%")
End Sub
End Class
Tags :

Derekadk
Rendering actual images instead of the markup in the control
Do you know if there is a property on the columns in the control that I can set to display the actual image in the table instead of the html markup tag?

eg: <img alt="" border=0 src="/PublishingImages/abc.jpg" style="border:0px solid">

Thanks!
Tags :

Page view tracker