Link to home
Start Free TrialLog in
Avatar of bertino12
bertino12

asked on

Programmatically fire gridview SelectedIndexChanged event

How can I programmatically fire the gridview SelectedIndexChanged event? I have the row Index value.

The function I am using is called PopGridView() and has no parameters.

Thanks,
Avatar of TornadoV
TornadoV
Flag of United States of America image

Avatar of bertino12
bertino12

ASKER

Sorry, I should have said I need this to happen client side

I have a clientside function called PopGridView() and I need to fire the selectedIndexChanged event inside of it. I have the row index already.


 Private Sub PopGridView(byval RowIndex as integer)
        'Fire the SelectedIndexChanged Event with RowIndex
  End Sub
I just got it working by changing the SelectedIndexChanged parameters to optional, then just calling the function itself. I dont know if this is a bad thing, but it seems to work fine.

Private Sub gvSchedule_SelectedIndexChanged(Optional ByVal sender As Object = Nothing, Optional ByVal e As System.EventArgs = Nothing) Handles gvSchedule.SelectedIndexChanged
           'Do some things.
End Sub

Private Sub PopGridView()
        gv_SelectedIndexChanged()
End Sub
This will work just fine.
ASKER CERTIFIED SOLUTION
Avatar of Vee_Mod
Vee_Mod
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial