how do i tell datagridview to do something automatically???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chocomon
    New Member
    • Feb 2012
    • 10

    how do i tell datagridview to do something automatically???

    hello~
    i was wondering how can i tell datagridview to do something automatically?
    for example...usual ly its easy to tell datagridview to do whatever if you click anywhere in the datagridview... but i want datagrid view to do something as soon as the program is running

    i was thinking that i have to change the private sub 'handles' to something but idk which event to choose...curren tly my program works if the datagridview handles 'cellcountclick ' which i don't want

    i've attached the code...BTW I'M USING VISUAL BASICS 10
    Attached Files
  • ADezii
    Recognized Expert Expert
    • Apr 2006
    • 8834

    #2
    You need to Shift your Code to an Event handler that is fired when the DataGridView is initially Loaded, such as the RowEnter() Event.
    Last edited by NeoPa; Feb 27 '12, 03:44 PM. Reason: Removed unnecessary quote.

    Comment

    • chocomon
      New Member
      • Feb 2012
      • 10

      #3
      THANK YOU FOR THE REPLY!!!
      so are you saying i need to put that code in my 'clickdatagridv iew' private sub to a rowenter() event?
      sorry but i'm not sure what you mean by a rowenter() event...how do i make that?

      PS. No wait. Sorry i know what you mean =) ...event as in after 'handles'....it s just i can't get the right one
      Last edited by NeoPa; Feb 27 '12, 03:45 PM. Reason: No need for two posts here.

      Comment

      • ADezii
        Recognized Expert Expert
        • Apr 2006
        • 8834

        #4
        Code:
        'Declaration
        Public Event RowEnter As DataGridViewCellEventHandler
        Code:
        Private Sub dataGridView1_RowEnter(ByVal sender As Object, _
            ByVal e As DataGridViewCellEventArgs) _
            Handles dataGridView1.RowEnter
        End Sub

        Comment

        Working...