Welcome to the Xceed Community | Help
Community Search  
More Search Options

Grid's MouseUp Event?

Sort Posts: Previous Next
  •  02-18-2010, 10:33 AM Post no. 25858

    Grid's MouseUp Event?

    I created a grid control using the following:
       Private WithEvents gridControl1 As Xceed.Grid.GridControl
       
    The MouseUp event for the Grid is never called
       Private Sub gridControl1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gridControl1.MouseUp
       
    What am I doing wrong?
    Filed under:
  •  02-18-2010, 11:10 AM Post no. 25861 in reply to 25858

    Re: Grid's MouseUp Event?

    Hi Morgan,

    When dealing with mouse and keyboard events, once there are rows in the grid, if these rows contain cells, it is the cells that will raise the mouse and keyboard events. If the row does not have cells, then it is the row that will raise the events. With the mouse and keyboard events, it is easier to think of the grid as a panel containing "child" rows which in turn contain "child" cells. 

    You won't get mouse and keyboard events directly from the grid once it contains data, therefore you will need to subscribe to the Click event of each cell of the DataRowTemplate.

     

    For example:

    starterGrid.DataRowTemplate.Cells["UnitsInStock"].MouseUp += new MouseEventHandler(StarterGrid_MouseUp);

    void StarterGrid_MouseUp(object sender, MouseEventArgs e)

            {

                object ob = sender;

            }

    ..

     


    Xceed - Software Developer and Technical Support
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.