Solved

GridviewRowEventArgs class wrapper

Posted on 2013-02-04
3
622 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 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Hi,

Aaah, OK!

Hope it helps u...
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now