Click here to Skip to main content
15,910,123 members
Home / Discussions / C#
   

C#

 
AnswerRe: More-Automated Windows Forms Help? Pin
Heath Stewart23-Nov-04 8:47
protectorHeath Stewart23-Nov-04 8:47 
Generalcatch app Exit Pin
IvyLee23-Nov-04 6:28
IvyLee23-Nov-04 6:28 
GeneralRe: catch app Exit Pin
Daniel Turini23-Nov-04 8:10
Daniel Turini23-Nov-04 8:10 
GeneralToolbar Pin
nickthemiragorobot23-Nov-04 5:44
nickthemiragorobot23-Nov-04 5:44 
GeneralRe: Toolbar Pin
Luis Alonso Ramos23-Nov-04 10:43
Luis Alonso Ramos23-Nov-04 10:43 
GeneralAvoiding multiple instances of an Application Pin
sommarafton23-Nov-04 3:43
sommarafton23-Nov-04 3:43 
GeneralRe: Avoiding multiple instances of an Application Pin
Jesse Squire23-Nov-04 3:56
Jesse Squire23-Nov-04 3:56 
GeneralTwo dimensional strongly typed collection Pin
Jan R Hansen23-Nov-04 3:36
Jan R Hansen23-Nov-04 3:36 
Hi,

I need to represent a table (rows and columns) of a "Cell" class. I would like to be able to do the following on an instance of my CustomTable class:

table.Rows[2][6] - and get a specific Cell
table.Cols[6][2] - and get that same Cell out

So - I need a two dimensional collection of Cell-objects. And a way of adding properties to the table class to look in that two dimensional collection. If we look at the Rows property, it could be made like this:

public RowCollection Rows<br />
{<br />
    get { return m_rows;}<br />
}


- where the RowCollection e.g. inherits from System.Collections.CollectionBase and implements the index-operator [] in order to get Row class instances out. These, in turn, must either be a collection of cell objects or have a .Items property which is a cellcollection (this would change the notation from table.Rows[2][6] to table.Rows[2].Items[6]).

However - making this work with the table.Cols[6][2] indexing as well requires that the table class has a m_rows collection of rows and a m_cols collection of columns - that both look into the same datasource - some sort of a two dimensional collection to represent the cells. I can't really think of a "sleek" way to implement this - I keep ending up with loads of collections and I have this thought nagging in the back of my head... This must have been done around a thousand times before Smile | :)

The main argument for having this as collections is that I need dynamic resizing at some point in time. And I feel a need for having a Row and Column class to hold some specific information for rows and columns - but if the Row class is just a Cell collection, it isn't really obvious to add properties to that class that are specific for the Row (the column, respectively).

Does anybody have any ideas or thoughts on this ? Of course, I'm probably just missing something really obvious here... Big Grin | :-D

Anyone ?


Do you know why it's important to make fast decisions? Because you give yourself more time to correct your mistakes, when you find out that you made the wrong one. Chris Meech on deciding whether to go to his daughters graduation or a Neil Young concert
GeneralRe: Two dimensional strongly typed collection Pin
benjymous23-Nov-04 5:08
benjymous23-Nov-04 5:08 
GeneralRe: Two dimensional strongly typed collection Pin
Jan R Hansen23-Nov-04 5:51
Jan R Hansen23-Nov-04 5:51 
GeneralRe: Two dimensional strongly typed collection Pin
benjymous23-Nov-04 21:54
benjymous23-Nov-04 21:54 
GeneralCalling constructors Pin
pjholliday23-Nov-04 2:57
pjholliday23-Nov-04 2:57 
GeneralRe: Calling constructors Pin
S. Senthil Kumar23-Nov-04 3:12
S. Senthil Kumar23-Nov-04 3:12 
GeneralRe: Calling constructors Pin
Heath Stewart23-Nov-04 6:06
protectorHeath Stewart23-Nov-04 6:06 
GeneralRe: Calling constructors Pin
Daniel Turini23-Nov-04 8:05
Daniel Turini23-Nov-04 8:05 
GeneralPersist ListViewItem backColor when using HideSelection= false Pin
the last free name23-Nov-04 0:05
the last free name23-Nov-04 0:05 
GeneralRe: Persist ListViewItem backColor when using HideSelection= false Pin
mhmoud rawas23-Nov-04 1:37
mhmoud rawas23-Nov-04 1:37 
GeneralCalling C# functions from a DLL from within unmanaged C++ Pin
Uwe Keim22-Nov-04 22:18
sitebuilderUwe Keim22-Nov-04 22:18 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
mhmoud rawas23-Nov-04 1:47
mhmoud rawas23-Nov-04 1:47 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Mike Dimmick23-Nov-04 2:20
Mike Dimmick23-Nov-04 2:20 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Uwe Keim23-Nov-04 19:29
sitebuilderUwe Keim23-Nov-04 19:29 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Nick Parker23-Nov-04 4:57
protectorNick Parker23-Nov-04 4:57 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Uwe Keim23-Nov-04 5:02
sitebuilderUwe Keim23-Nov-04 5:02 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Heath Stewart23-Nov-04 5:58
protectorHeath Stewart23-Nov-04 5:58 
GeneralRe: Calling C# functions from a DLL from within unmanaged C++ Pin
Uwe Keim23-Nov-04 6:11
sitebuilderUwe Keim23-Nov-04 6:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.