Click here to Skip to main content
15,909,898 members
Home / Discussions / C#
   

C#

 
QuestionDatagrid Context Menu Pin
OrbeaOrca7-Feb-06 10:11
OrbeaOrca7-Feb-06 10:11 
QuestionSendMessage problems Pin
sowhatman007-Feb-06 9:21
sowhatman007-Feb-06 9:21 
AnswerRe: SendMessage problems Pin
sowhatman007-Feb-06 23:54
sowhatman007-Feb-06 23:54 
QuestionCan't get "TreeNodeCollection.Contains" to validate node Pin
JstDaNuGuy7-Feb-06 9:15
JstDaNuGuy7-Feb-06 9:15 
AnswerCan a guy get some help over here??? Pin
JstDaNuGuy8-Feb-06 4:41
JstDaNuGuy8-Feb-06 4:41 
QuestionGroupbox border color Pin
VPMahank7-Feb-06 8:53
VPMahank7-Feb-06 8:53 
AnswerRe: Groupbox border color Pin
DigitalKing7-Feb-06 15:32
DigitalKing7-Feb-06 15:32 
QuestionCustom Object that has 'nested' collections Pin
kloepper7-Feb-06 8:52
kloepper7-Feb-06 8:52 
The problem:

I want to allow an administrator (user) to create a list of teachers, each teacher in turn has a list of classes, each class has a list of students.

There's an article at http://aspalliance.com/721 that describes making classes for the Student and the StudentList, but I'm wondering how to make classes that are collections of the other classes, ie a ClassList that holds the StudentList class and a TeacherList class that holds the ClassList class.

TeacherList-->ClassList-->StudentList-->Student

What is the approach to use to make a custom object that could handle this nesting?

The article mentioned above has a StudentList Class that inherits from IEnumerable and uses a Hastable to hold the Student objects that are made up of simple data types. I tried making classes in a similar fashion for the ClassList and StudentList collections, but I'm having casting errors, so I'm not sure that this is the correct approach or my implementation is not correct.

Anyone have any ideas or suggestions as to how to nest collections like this? or another approach to accomplish the same thing? If you want to see the code I've tried, I can post it.

Thanks,

Paul

AnswerRe: Custom Object that has 'nested' collections Pin
Guffa7-Feb-06 9:16
Guffa7-Feb-06 9:16 
GeneralRe: Custom Object that has 'nested' collections Pin
kloepper7-Feb-06 9:46
kloepper7-Feb-06 9:46 
AnswerRe: Custom Object that has 'nested' collections Pin
Guffa7-Feb-06 10:56
Guffa7-Feb-06 10:56 
QuestionInclude files Pin
dvsr7-Feb-06 8:51
dvsr7-Feb-06 8:51 
AnswerRe: Include files Pin
Guffa7-Feb-06 9:21
Guffa7-Feb-06 9:21 
GeneralRe: Include files Pin
dvsr8-Feb-06 4:43
dvsr8-Feb-06 4:43 
AnswerRe: Include files Pin
Guffa8-Feb-06 6:07
Guffa8-Feb-06 6:07 
QuestionHRESULT E_FAIL Error? Pin
Mertli Ozgur Nevres7-Feb-06 6:36
Mertli Ozgur Nevres7-Feb-06 6:36 
AnswerRe: HRESULT E_FAIL Error? Pin
Dave Kreskowiak7-Feb-06 7:01
mveDave Kreskowiak7-Feb-06 7:01 
GeneralRe: HRESULT E_FAIL Error? Pin
Mertli Ozgur Nevres8-Feb-06 1:05
Mertli Ozgur Nevres8-Feb-06 1:05 
GeneralRe: HRESULT E_FAIL Error? Pin
Dave Kreskowiak8-Feb-06 2:01
mveDave Kreskowiak8-Feb-06 2:01 
GeneralRe: HRESULT E_FAIL Error? Pin
Mertli Ozgur Nevres8-Feb-06 22:46
Mertli Ozgur Nevres8-Feb-06 22:46 
GeneralRe: HRESULT E_FAIL Error? Pin
Dave Kreskowiak9-Feb-06 3:07
mveDave Kreskowiak9-Feb-06 3:07 
QuestionRunning SQL in a Thread Pin
MarkMokris7-Feb-06 5:43
MarkMokris7-Feb-06 5:43 
AnswerRe: Running SQL in a Thread Pin
Le centriste7-Feb-06 7:08
Le centriste7-Feb-06 7:08 
AnswerRe: Running SQL in a Thread Pin
LighthouseJ7-Feb-06 7:58
LighthouseJ7-Feb-06 7:58 
QuestionObject reference not set to an instance of an object. Pin
subbaraju7-Feb-06 5:30
subbaraju7-Feb-06 5:30 

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.