Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

GridviewRowEventArgs class wrapper

Posted on 2013-02-04
3
Medium Priority
?
652 Views
Last Modified: 2013-02-05
I have created my own controls that inherit from the .net controls. Then I reference the new custom controls in my code behind and erase "using system.web.ui.webcontrols"

This works as expected on almost everything.

The problem is when I call some gridview events, it does not recognize the type of argument.

protected void gvGridview_RowDataBound(GridViewRowEventArgs e)

Open in new window


One method to fix would be:

protected void gvGridview_RowDataBound(System.Web.UI.WebControls.GridViewRowEventArgs e)

Open in new window


However, I do not wish to do this because there are literally hundreds of applications that will use these custom controls. My wish is to drop it in, change the "Using" statement so it references my class library, then change the base page so it inherits my base page and be done.

I've researched and it seems you cannot override types. I've seen some mention of custom class wrappers, and aliases. I'm not sure what is best on how to do this. I assume (and may be wrong) that Telerik does this unless they created their RadGrid from the ground up and never inherit gridview.

Thanks!
0
Comment
Question by:nevernerd
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
Roopesh Reddy earned 2000 total points
ID: 38854466
Hi,

Yeah!

Moreover, GridViewRowEventArgs is derived from EventArgs. So did you tried implementing the custom functionality as GridViewRowEventArgs do?

http://forums.asp.net/t/1001258.aspx

Hope it helps u...
0
 

Author Comment

by:nevernerd
ID: 38854670
I tried something similar but it was based on an example I did not understand cause they replaced everything with meaningless names :) This is a good example. I can't wait to try it.
0
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 38854905
Hi,

Aaah, OK!

Hope it helps u...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question