ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1TrueDBGrid.FormatText Event

Occurs whenever a cell is about to be rendered and whose C1DataColumn.NumberFormat property has been set to FormatTextEvent.

[Visual Basic]

Public Event FormatText As FormatTextEventHandler

[C#]

public event FormatTextEventHandler FormatText

[Delphi]

public property FormatText: FormatTextEventHandler read remove_FormatText write add_FormatText;

Example

The following code creates a FormatText event handler that is raised when the cells in the second column are rendered and its C1DataColumn.NumberFormat property is set to FormatTextEvent:

·      Visual Basic

       ' Set the number format of a column to be "FormatTextEvent".

       Me.C1TrueDBGrid1.Columns(1).NumberFormat = "FormatTextEvent"

       Private Sub c1TrueDBGrid1_FormatText(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.FormatTextEventArgs) Handles c1TrueDBGrid1.FormatText

           e.Value = e.value & "west"

       End Sub

·      C#

       // Set the number format of a column to be "FormatTextEvent".

       this.c1TrueDBGrid1.Columns[1].NumberFormat = "FormatTextEvent";

       private void c1TrueDBGrid1_FormatText(object sender, C1.Win.C1TrueDBGrid.FormatTextEventArgs e)

       {

           e.Value = e.value + "west"

       }

·      Delphi

       // Set the number format of a column to be "FormatTextEvent".

       Self.C1TrueDBGrid1.Columns[1].NumberFormat := 'FormatTextEvent';

       procedure C1TrueDBGrid1_FormatText(sender: System.Object; e: C1.Win.C1TrueDBGrid.FormatTextEventArgs);

       begin

         e.Value := e.value + 'west';

       end;

See Also

C1TrueDBGrid Class | C1TrueDBGrid Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.