?
Solved

GridviewRowEventArgs class wrapper

Posted on 2013-02-04
3
Medium Priority
?
646 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

718 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