M
Merk
I need to show users a list of "Person" attributes in a grid. I currently
have a custom "Person" class that mostly has a bunch of string properties
(firstName, lastName, etc).
While I want to have a collection of [a few hundred] Person objects behind
the scenes, I want for only a specific subset to appear in the grid at any
given time. The subset would be determined by rules such as (ID Number
Between 100 and 130, or lastName begins with "SCH"), and the user will
control which rule is in effect (i.e., user can specify which subset appears
in the grid).
How would you go about implementing the above? I went in the direction of
the following, but it seems overly complicated.
So I was thinking to have two collections - one for all Person objects
(lstAll), and another collection for the currently viewed subset
(lstCurrent). My intention was to have lstAll be an instance of the generic
..List<T> - but for lstCurrent to be a BindingList<T> instance (and bound to
the grid). I wanted to somehow use the FindAll method of lstAll (a List<T>)
to get references to the requisite Person objects into lstCurrent (a
BindingList<T>). But I'd prefer to do this without looping if there is a
faster way. Speed is important especially as the size of lstAll grows.
I'd appreciate any recommendations for how to proceed. I'm feeling "in a bit
over my head" at this point.
Thanks!
have a custom "Person" class that mostly has a bunch of string properties
(firstName, lastName, etc).
While I want to have a collection of [a few hundred] Person objects behind
the scenes, I want for only a specific subset to appear in the grid at any
given time. The subset would be determined by rules such as (ID Number
Between 100 and 130, or lastName begins with "SCH"), and the user will
control which rule is in effect (i.e., user can specify which subset appears
in the grid).
How would you go about implementing the above? I went in the direction of
the following, but it seems overly complicated.
So I was thinking to have two collections - one for all Person objects
(lstAll), and another collection for the currently viewed subset
(lstCurrent). My intention was to have lstAll be an instance of the generic
..List<T> - but for lstCurrent to be a BindingList<T> instance (and bound to
the grid). I wanted to somehow use the FindAll method of lstAll (a List<T>)
to get references to the requisite Person objects into lstCurrent (a
BindingList<T>). But I'd prefer to do this without looping if there is a
faster way. Speed is important especially as the size of lstAll grows.
I'd appreciate any recommendations for how to proceed. I'm feeling "in a bit
over my head" at this point.
Thanks!