473,386 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Class inheritance

This is an easy question for many of you; I just can't seem to be catching
everything.
I am trying to create a custom DataGrid class that, of course, inherits from
System.Windows.Forms.DataGrid. The only thing I am trying to do is add a
method to the class called ScrollToRow() that automatically scrolls to a
specifc row in the datagrid based on the "row" argument as displayed below:
Public Class DataGridCustom
Inherits DataGrid
Sub ScrollToRow(ByVal row As Integer)
Me.GridVScrolled(Me, New
ScrollEventArgs(ScrollEventType.LargeIncrement, row))
End Sub
End Class

I have tried declaring an object of DataGridCustom in code and setting all
of its properties (including datasource) at run-time, but the grid is not
visible for some reason and I have tried just about everything I know to
make it visible.
My questions are:
1. can I reference this custom datagrid in the designer?
2. what am I doing wrong so that it is not visible/showing up?
--
Scott Adams
~~ not the Dilbert guy ~~
~~ not the creator of the Adventure series ~~
Jul 21 '05 #1
1 1202
You could place your datagrid in a separate project (class library) so it
compiles into a dll. Then you can drag and drop this dll from the windows
explorer on the VS.NET toolbox.

Or you can rightclick on the toolbox and choose Add/Remove items... and then
browse to your dll.

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Scott Adams" <sc*********@npiusa.com> schreef in bericht
news:%2****************@TK2MSFTNGP12.phx.gbl...
This is an easy question for many of you; I just can't seem to be catching
everything.
I am trying to create a custom DataGrid class that, of course, inherits from System.Windows.Forms.DataGrid. The only thing I am trying to do is add a
method to the class called ScrollToRow() that automatically scrolls to a
specifc row in the datagrid based on the "row" argument as displayed below: Public Class DataGridCustom
Inherits DataGrid
Sub ScrollToRow(ByVal row As Integer)
Me.GridVScrolled(Me, New
ScrollEventArgs(ScrollEventType.LargeIncrement, row))
End Sub
End Class

I have tried declaring an object of DataGridCustom in code and setting all
of its properties (including datasource) at run-time, but the grid is not
visible for some reason and I have tried just about everything I know to
make it visible.
My questions are:
1. can I reference this custom datagrid in the designer?
2. what am I doing wrong so that it is not visible/showing up?
--
Scott Adams
~~ not the Dilbert guy ~~
~~ not the creator of the Adventure series ~~

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Ricky Romaya | last post by:
Hi, Are there any ways to get multiple inheritace in PHP4? For example, I have 3 parent class, class A, B, and C. I want class X to inherit all those 3 classes. Consider merging those 3 classes...
6
by: Brian Jones | last post by:
I'm sure the solution may be obvious, but this problem is driving me mad. The following is my code: class a(object): mastervar = def __init__(self): print 'called a'
22
by: Marcin Vorbrodt | last post by:
Taken out of C++ In a Nutshell book... Example 7-18: Using an abstract classes as interface specification. struct Runnable { virtual void run() = 0; }; struct Hashable { virtual size_t...
9
by: mead | last post by:
What kind of classes is qualified as "concrete classes"? When should a member function in a class defined as "pure virtual" and when as "virtual"? Thanks!
4
by: KInd | last post by:
Hello All, When is nested class more preferable that Inheritance ? I think with proper inheritance and friend class concept we can get the same flexibility as nested classes Any comments .. Best...
166
by: Graham | last post by:
This has to do with class variables and instances variables. Given the following: <code> class _class: var = 0 #rest of the class
11
by: Darren.Ratcliffe | last post by:
Hi guys Posted what was probably a rather confusing post about this the other day, so I am going to have another go and see if I can make more sense. This sis purely a I've got a base class...
3
by: hurcan solter | last post by:
Consider the code fragment; class A { public: A(){} A(int prm):mprm(prm){} int mprm; }; class B:public A {
3
by: Jam | last post by:
Hello All, Your comment is needed on following subject,i define the Class and Inheritance as following,what do you think? Class: Class is a set of objects which shares common states and...
3
by: Ravi | last post by:
Is this the correct way to think of "base class"? The "base class" is a class from which other classes are derived. The "base class" will never be derived from another class.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.