1.11M Members

How to Add event in the dynamic Gridview control?

 
0
 

Hi guys,

i am facing a problem which is i need to create a dynamic gridview control and i need to add eventhandler for this gridview. Therefore, how i add the event?

 
0
 

are you creating that gridview at runtime?
then your could add a global declaration: Private withevents dataGV as datagridview after this you can already find the events for that control just as all others.
and use it on runtime like: dataGV = new gridview

 
0
 

Use AddHandler and RemoveHandler to add or remove event handlers dynamically.

 
0
 

use add handler

ex:

addhandler gridview.click , addressof event

sub event(ByVal sender As System.Object, ByVal e As System.EventArgs)

msgbox("OK")

end sub

suppose the event you want when gridview clicked
and what you want to do put it in another sub

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article