ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1TrueDBDropdown.FetchRowStyle Event

Occurs whenever the grid is about to display a row of data and the FetchRowStyles property is True.

[Visual Basic]

Public Event FetchRowStyle As FetchRowStyleEventHandler

[C#]

public event FetchRowStyleEventHandler FetchRowStyle

[Delphi]

public property FetchRowStyle: FetchRowStyleEventHandler read remove_FetchRowStyle write add_FetchRowStyle;

Example

The following code displays all rows with Germany in the Country column in LemonChiffon:

·      Visual Basic

       Private Sub C1TrueDBDropdown1_FetchRowStyle(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.FetchRowStyleEventArgs) Handles C1TrueDBDropdown1.FetchRowStyle

           Dim S As String = C1TrueDBDropdown1.Columns("Country").CellText(e.Row).ToString

           If S <> "Germany" Then

               e.CellStyle.BackColor = System.Drawing.Color.LemonChiffon

           End If

       End Sub

·      C#

       private void c1TrueDBDropdown1_FetchRowStyle(object sender, C1.Win.C1TrueDBGrid.FetchRowStyleEventArgs e)

       {

           string S = C1TrueDBGrid1.Columns("Country").CellText(e.Row).ToString;

           if (S != "Germany")

           {

               e.CellStyle.BackColor = System.Drawing.Color.LemonChiffon;

           }

       }

·      Delphi

       Procedure TForm1.C1TrueDBDropdown1_FetchRowStyle(sender: System.Object; e: C1.Win.C1TrueDBGrid.FetchRowStyleEventArgs);

       var

         S: string;

       begin

         S := C1TrueDBGrid1.Columns['Country'].CellText(e.Row).ToString;

         if (S <> 'Germany') then

           e.CellStyle.BackColor := System.Drawing.Color.LemonChiffon;

       end;

See Also

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


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