Share via


: SPMobileBaseFieldControl.CreateControlForDisplay (Método) (Microsoft.SharePoint.MobileControls)

Creates a control for rendering the field on a Display item form.

Espacio de nombres:
Ensamblado: Microsoft.SharePoint (in microsoft.sharepoint.dll)

Sintaxis

'Declaración
Protected Overridable Function CreateControlForDisplay As MobileControl
'Uso
Dim returnValue As MobileControl

returnValue = Me.CreateControlForDisplay
protected virtual MobileControl CreateControlForDisplay ()

Valor devuelto

A MobileControl that renders the field on a Display form.

Comentarios

The default implementation calls CreateControlForView.

Ejemplo

The following example shows an override of CreateControlForDisplay that adds a search text box after the item title on a Display form. For the full example, see Tutorial: creación de un control de representación de campos personalizado para páginas móviles.

protected override MobileControl CreateControlForDisplay()
{
   string title = Convert.ToString(this.ItemFieldValue);
   if (!String.IsNullOrEmpty(title))
   {
      this.LabelControl.BreakAfter = false;
      this.LabelControl.Text = title + " ";

      this.LinkControl.BreakAfter = false;
      this.LinkControl.Text = "Search";
      this.LinkControl.NavigateUrl = "https://search.msn.com/results.aspx?q=" + title.Replace(' ', '+');

      Panel panel = new Panel();
      panel.BreakAfter = false;
      panel.Controls.Add(this.LabelControl);
      panel.Controls.Add(this.LinkControl);

      return panel;
   }
   return null;
}

Vea también

Referencia

SPMobileBaseFieldControl (Clase)
SPMobileBaseFieldControl (Miembros)
Microsoft.SharePoint.MobileControls (Espacio de nombres)