Solved

GridviewRowEventArgs class wrapper

Posted on 2013-02-04
3
636 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 500 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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

734 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