Click here to Skip to main content
15,884,986 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
Hi,

I want some clarification about GridView and other control in .Net.

I was playing with GridView and then I came across
C#
protected void gvDetails_RowEditing(object sender, GridViewEditEventArgs e)"
on server side code.

I right click to GridViewEditEventArgs e to see its definition and found namespace using System.ComponentModel in its class implementation.

My Question is that -

Is GridView a ComponentModel ?
and if not does it has to do anything with Component?

What is COM object ? Is there any relation between it and asp.net control(button, drop down)etc ?

Thanks in advance
Posted
v2
Comments
Sergey Alexandrovich Kryukov 28-May-13 10:01am    
Why using COM in ASP.NET development at all? My question is probably useless though, as I cannot be sure you understand what you are asking about; the post is too vague...
—SA
Hi Sergey Alexandrovich Kryukov,

I am a big fan of yours. Please review my answer. I may be wrong on this. Or else you can add or modify it.
I have differenciated the GridView with it's EditEventArgs class as he was asking My Question is that is Gridview is compnentModel...

Thanks,
Tadit
rameshKumar1717 28-May-13 10:39am    
Tadit thanks,You clarified my query.
Great to hear that. I did a bit of research for that.

Please accept this answer, if it has helped you in any way.
This will help others to find the answer in one go and you will also be awarded with some points for this action...
Sergey Alexandrovich Kryukov 28-May-13 12:33pm    
Tadish,

Thank you for your nice words and your note. I did not want to answer because the question was too naive and vague, but as you took the responsibility for at least part of it, I'm joining with some addition.

—SA

GridView

GridView Class[^].
Quote:
Displays the values of a data source in a table where each column represents a field and each row represents a record. The GridView control enables you to select, sort, and edit these items.

Inheritance Hierarchy
System.Object
  System.Web.UI.Control
    System.Web.UI.WebControls.WebControl
      System.Web.UI.WebControls.BaseDataBoundControl
        System.Web.UI.WebControls.DataBoundControl
          System.Web.UI.WebControls.CompositeDataBoundControl
            System.Web.UI.WebControls.GridView

GridViewEditEventArgs

GridViewEditEventArgs Class[^].
Quote:
Provides data for the RowEditing event.

Inheritance Hierarchy
System.Object 
  System.EventArgs
    System.ComponentModel.CancelEventArgs
      System.Web.UI.WebControls.GridViewEditEventArgs

System.ComponentModel

System.ComponentModel Namespace[^].
Quote:
The System.ComponentModel namespace provides classes that are used to implement the run-time and design-time behavior of components and controls. This namespace includes the base classes and interfaces for implementing attributes and type converters, binding to data sources, and licensing components.

My conclusions

From the above, what I can understand is that

  • The GridView is a Web UI Control as it is derived from Namespace System.Web.UI.Control.
    Thus, GridView is not a ComponentModel (which was one of your questions).
  • The GridViewEditEventArgs is derived from Namespace System.ComponentModel.CancelEventArgs, so the event has relation with System.ComponentModel class in this way.

    This ComponentModel class provides class CancelEventArgs Class[^], which at last provides data for a cancelable event.



Hope you get the concepts... :)
 
Share this answer
 
Comments
rameshKumar1717 28-May-13 11:27am    
One more question Tadit, what is the use of com object in present scenario more specifically in .net world, I read many article but not satisfied, some one saying old technology do not learn it, someone say you should go for it, I am bit confuse.
Thank You
Sergey Alexandrovich Kryukov 28-May-13 12:31pm    
OK, I voted 5 and tried to answer the remaining question; please see Solution 2.
—SA
Thanks a lot @Sergey Alexandrovich Kryukov... :)

Solution 2 is another product of Brand Sergey... Nice one.
Sergey Alexandrovich Kryukov 28-May-13 15:54pm    
Thank you, Tadit.
—SA
Most Welcome... :)
That is Tadit... :D :P
Ramesh asked:
What is the use of COM object in present scenario..?
There is no such role. Why?

ASP.NET is nothing but a plug-in for the HTTP server (HTTP server's terminology more usually operates the term "module") which programmatically handles some HTTP requests and generate HTTP responses. The ASP.NET controls are no more than wrappers of HTTP control and other elements.

COM, from the other hand, is a sophisticated work-around of the non-OOP OS (more exactly OS APIs; for example, Windows is inherently object-oriented in its internal design, but it exposed non-OOP API, to support development with non-OOP languages), designed to add the support for OOP programming, and, importantly, to restore the compatibility between languages and system, which was essentially lost in competition between different ambitious companies, organizations and teams who did not want to get into agreements. In other words, it was designed as some crutches to fix the lameness.

As .NET was originally designed as OOP platform, and non-OOP languages are completely out of the picture, it does not need such crutches. COM is still used internally to interface with some OS component and exposed to the developer, also to be used for compatibility reasons. Why would such trash be ever needed in ASP.NET? No reasons.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900