2 Replies - 1635 Views - Last Post: 16 May 2014 - 06:03 AM Rate Topic: -----

#1 Emwat Oon  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 54
  • Joined: 07-January 12

Dynamically assign Rowdatabound to Gridview?

Posted 15 May 2014 - 12:59 PM

How do I get this line of code to work?

GridView1.RowDataBound += GridView1_RowDataBound();



This gives the following error.

No overload for method 'GridView1_RowDataBound' takes 0 arguments


I know I can assign it in the web form instead of the code-behind, but for my purposes, it needs to fill a certain condition or else the GridView just breaks.

Is This A Good Question/Topic? 0
  • +

Replies To: Dynamically assign Rowdatabound to Gridview?

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 9570
  • View blog
  • Posts: 36,240
  • Joined: 12-June 08

Re: Dynamically assign Rowdatabound to Gridview?

Posted 15 May 2014 - 01:01 PM

http://msdn.microsof...y/ms366768.aspx

Try

this.<event name> += new System.EventHandler(<method name>);

Was This Post Helpful? 1
  • +
  • -

#3 Emwat Oon  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 54
  • Joined: 07-January 12

Re: Dynamically assign Rowdatabound to Gridview?

Posted 16 May 2014 - 06:03 AM

Sorry if this is a double post.

Well, the line of code I posted now works. I'm not sure how or the why. I'm hoping it suddenly doesn't break.

But I will study up on that msdn link, since I'm not too familiar with the concept. Thank you.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1