473,507 Members | 11,134 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rows

Hello,

I created a custom control, Parent, with the following property:

Property Rows As Generic.List(Of Row)

Row is another custom control that creates some code.

The problem is that I want to create different types of rows:
InputRow, CheckRow, ...

All rows render the same way, i.e., a div with content inside it. The
content in the div is different for each row.

Basically I would like to do something like:

Dim MyParent As Parent

MyParent.Rows.Add(MyNormalRow)

MyParent.Rows.Add(MyInputRow)

MyParent.Rows.Add(MyCheckRow)

....

What should be the best way to do this?

Thanks,

Miguel

Oct 29 '07 #1
3 992
It happens that shapper formulated :
Hello,

I created a custom control, Parent, with the following property:

Property Rows As Generic.List(Of Row)

Row is another custom control that creates some code.

The problem is that I want to create different types of rows:
InputRow, CheckRow, ...

All rows render the same way, i.e., a div with content inside it. The
content in the div is different for each row.

Basically I would like to do something like:

Dim MyParent As Parent

MyParent.Rows.Add(MyNormalRow)

MyParent.Rows.Add(MyInputRow)

MyParent.Rows.Add(MyCheckRow)

...

What should be the best way to do this?

Thanks,

Miguel
Create a baseclass "Row" (probably needs to derive from "Control") and
derive InputRow, CheckRow, etc from that Row.

You can put common functions in the baseclass and special functions in
the various derived classes.

Hans Kesting
Oct 29 '07 #2
On Oct 29, 3:24 pm, Hans Kesting <invalid.han...@spamgourmet.com>
wrote:
It happens that shapper formulated :
Hello,
I created a custom control, Parent, with the following property:
Property Rows As Generic.List(Of Row)
Row is another custom control that creates some code.
The problem is that I want to create different types of rows:
InputRow, CheckRow, ...
All rows render the same way, i.e., a div with content inside it. The
content in the div is different for each row.
Basically I would like to do something like:
Dim MyParent As Parent
MyParent.Rows.Add(MyNormalRow)
MyParent.Rows.Add(MyInputRow)
MyParent.Rows.Add(MyCheckRow)
...
What should be the best way to do this?
Thanks,
Miguel

Create a baseclass "Row" (probably needs to derive from "Control") and
derive InputRow, CheckRow, etc from that Row.

You can put common functions in the baseclass and special functions in
the various derived classes.

Hans Kesting
So by having my classes inherit from RowClass I then can add any of
the other classes directly in property of type Generic.List(Of Row).
Is this what you mean right?

Thanks,
Miguel

Oct 29 '07 #3
shapper explained :
On Oct 29, 3:24 pm, Hans Kesting <invalid.han...@spamgourmet.com>
wrote:
>It happens that shapper formulated :
>>Hello,
>>I created a custom control, Parent, with the following property:
Property Rows As Generic.List(Of Row)
Row is another custom control that creates some code.
The problem is that I want to create different types of rows:
InputRow, CheckRow, ...
>>All rows render the same way, i.e., a div with content inside it. The
content in the div is different for each row.
Basically I would like to do something like:
Dim MyParent As Parent
>>MyParent.Rows.Add(MyNormalRow)
>>MyParent.Rows.Add(MyInputRow)
>>MyParent.Rows.Add(MyCheckRow)
>>...
>>What should be the best way to do this?
Thanks,
>>Miguel

Create a baseclass "Row" (probably needs to derive from "Control") and
derive InputRow, CheckRow, etc from that Row.

You can put common functions in the baseclass and special functions in
the various derived classes.

Hans Kesting

So by having my classes inherit from RowClass I then can add any of
the other classes directly in property of type Generic.List(Of Row).
Is this what you mean right?

Thanks,
Miguel
Correct

Hans Kesting
Oct 31 '07 #4

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

Similar topics

7
12034
by: Egor Shipovalov | last post by:
I'm implementing paging through search results using cursors. Is there a better way to know total number of rows under a cursor than running a separate COUNT(*) query? I think PostgreSQL is bound...
6
2286
by: dddddddd2444444 | last post by:
Hi,please help... It works fine when I define a 2-D array like char code. But it won't work when I try to define the array dynamically using a function. It just crashes. Does anyone know why?...
7
3908
by: GaryB | last post by:
I have an untyped datatable that has financial numbers and controls that were populated by code (not a simple fill from a DA). Now I want to insert subtotals into it. I wrote a sub to do so that...
0
1806
by: Subba Rao via DotNetMonster.com | last post by:
---------------------------HTML---------------------------------------- <html> <head> <title>:: DHTML Table Demo ::</title> <script langauge="javascript" src="InterchangeRows.js"></script>...
12
1976
by: Graham Blandford | last post by:
Hi all, Would someone be able to tell me the most 'graceful' way of removing unwanted rows from a dataset based on a condition prior to update? OR, resetting the rows all to unchanged after they...
68
6747
by: Martin Joergensen | last post by:
Hi, I have some files which has the following content: 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0 0 0 0 0
11
7999
by: jimstruckster | last post by:
I have a table with 10 rows, I want all rows except for the first to be hidden when the page first opens up. If the user puts a value in a text box in the first row then I want the second row to...
3
5380
by: Niyazi | last post by:
Hi all, I have a dataTable that contains nearly 38400 rows. In the dataTable consist of 3 column. column 1 Name: MUHNO column 2 Name: HESNO Column 3 Name: BALANCE Let me give you some...
0
1786
by: rn5a | last post by:
All the rows in a DataGrid are accompanied by a CheckBox. When a user checks the rows & clicks a Button, the checked rows get deleted. For e.g. assume that the DataGrid displays 10 rows. A user...
3
3905
by: nigelesquire | last post by:
Please help! I'm trying to clone and delete multiple rows with JavaScript. I need two delete buttons that work...! I only have one for now, but it's not working properly, the output count is...
0
7223
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
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.