Skip to content

SetPreviewIndent Method

Description

Sets the indentation for the preview text while in preview mode.

Syntax

Public Sub SetPreviewIndent( _
    ByVal [left](#) As Integer, _
    ByVal [top](#) As Integer, _
    ByVal [right](#) As Integer, _
    ByVal [bottom](#) As Integer _
)

Parameters

  • left: Left indentation.
  • top: Top indentation.
  • right: Right indentation.
  • bottom: Bottom indentation.

Remarks

If text has been added to the PreviewText property and PreviewMode is enabled, a preview row is added to the bottom of each GridRecord and the text stored in the PreviewText property will be shown. The SetPreviewIndent method specifies the size of the indentation of the PreviewText.

The left, top, bottom, and right parameters can be thought of as the amount of "cell padding" placed around the PreviewText.

Example

Setting the preview text indentation (Visual Basic)

This sample illustrates how to set the indentation used when displaying the preview text for each GridRecord.

' This sample illustrates how to add PreviewText to a GridRecord  
' And how to change the indentation used when displaying the PreviewText  

Dim Record As GridRecord  
Dim Item As GridRecordItem  

' Adds a GridRecord with 5 GridRecordItems  
Set Record = wndGridControl.Records.Add  
    Set Item = Record.AddItem("")  
        Item.HasCheckbox = True  
        Item.Checked = False  
    Record.AddItem "RE: Your Invoice"  
    Record.AddItem "John Smith"  
    Record.AddItem "19/06/2004"  
    Record.AddItem "18k"  

' The text added to the PreviewText property will be displayed under this GridRecord  
' when in preview mode  
Record.PreviewText = "RE: Your Invoice (From: John Smith)" & vbCrLf & "19/06/2004"  

' This will cause the text stored in the PreviewText property to be displayed  
' with the specified indentation. This is similar to "cell padding."  
' You can specify the amount of "padding" placed around the preview text.  
' The text will be indented 20px from the Left  
' The text will be indented 5px from the Top  
' The text will be indented 0px from the Right  
' The text will be indented 5px from the Bottom  
wndGridControl.SetPreviewIndent 20, 5, 0, 5

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.