john
john

Reputation: 1

How to assign event handler programatically

I'm using DevExpress AspxGridView and I'm trying to assign OnCustomCallBack programatically in the Page_Load. but it didn't work. this is my code,

aspxGrid1.attributes.add("OnCustomCallback","MyServerSideFunctionName")

Upvotes: 0

Views: 595

Answers (2)

Stephen Wrighton
Stephen Wrighton

Reputation: 37819

In VB.Net, you would attach a handler in this fashion:

AddEventHandler aspxGrid1.CustomCallBack, addressof MyServerSideFunction

Upvotes: 0

Arthur
Arthur

Reputation: 8129

Do you mean this?

aspxGrid1.CustomCallback += new AspxGridViewCustomCallbackHandler(MyServerSideFunctionName);

(I have no DevExpress Controls so you have to adapt the delegates name.)

Or do you want to do it with Reflection?

Upvotes: 1

Related Questions