ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1TrueDBGrid.Scroll Event

Occurs whenever the user scrolls the grid.

[Visual Basic]

Public Event Scroll As CancelEventHandler

[C#]

public event CancelEventHandler Scroll

[Delphi]

public property Scroll: CancelEventHandler read remove_Scroll write add_Scroll;

Example

Suppose you have a ListBox control that appears in your grid when the user clicks the current cell. If you want to hide the ListBox once the user starts scrolling the grid, you would use the following code:

·      Visual Basic

       Private Sub C1TrueDBGrid1_Scroll(ByVal sender As Object, ByVal e As C1.Win.C1TrueDBGrid.CancelEventArgs) Handles C1TrueDBGrid1.Scroll

           Me.ListBox1.Visible = False

       End Sub

·      C#

       private void c1TrueDBGrid1_Scroll(object sender,  C1.Win.C1TrueDBGrid.CancelEventArgs e)

       {

           this.listBox1.Visible = false;

       }

·      Delphi

       procedure TWinForm.C1TrueDBGrid1_Scroll(sender: System.Object; e: C1.Win.C1TrueDBGrid.CancelEventArgs);

       begin

         Self.ListBox1.Visible := false;

       end;

See Tutorial 9 - Attaching an Arbitrary Drop-Down Control to a Grid Cell to see this code used within an application.

See Also

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


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