Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Filling DataGrid from collection class

Posted on 2004-10-28
7
Medium Priority
?
200 Views
Last Modified: 2010-04-15
Hello again,

is it possible to fill a datagrid based on a collection class?

my collection class is inheriting from the DictionaryBase class.

thanks

0
Comment
Question by:brdrok
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 13

Expert Comment

by:dungla
ID: 12442268
brdrok,

MSDN said: "The data source must be an object that implements the System.Collections.IEnumerable interface"

you can fill a datagrid based on a collection class which inheriting from the DictionaryBase class. Because DictionaryBase is the class implement IEnumerable interface.
0
 
LVL 7

Author Comment

by:brdrok
ID: 12444239
Hey dungla....

thanks for your feedback.  I can't seem to find "The data source must be an object that implements the System.Collections.IEnumerable interface".  Can you please provide a link.  

The closest thing i saw was: "The following data sources are valid: Any component that implements the IList interface"

However, from what I have gathered so far is that the "DictionaryBase" is implementing the following interfaces: ICollection, IEnumerable, and IDictionary. Does that mean, I am out of luck?  Does that mean I will have to declare my class like this:

public class Employees : DictionaryBase, IList

So many questions, and only so many hours in a day :)


0
 
LVL 7

Assisted Solution

by:NipNFriar_Tuck
NipNFriar_Tuck earned 75 total points
ID: 12445487
Hi brdrok, the answer to your question is yes.  The DictionaryBase inherits from ICollection, which is a parent of IList.  So you would need to include IList on your class definition and implement the needed functions for IList.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Author Comment

by:brdrok
ID: 12445702
NipNFriar...

thank you.  I have posted another question (400 pts) asking how to implement the Add method of the IList interface.  Can't seem to get it to work.  If you would like to take a crack at it, it should be there.  thanks

 
0
 
LVL 13

Expert Comment

by:dungla
ID: 12460579
brdrock

Here is the link in my MSDN July 2004

ms-help://MS.MSDNQTR.2004JUL.1033/cpref/html/frlrfSystemWebUIWebControlsBaseDataListClassDataSourceTopic.htm

The topic: BaseDataList.DataSource Property  [C#]
0
 
LVL 13

Accepted Solution

by:
dungla earned 225 total points
ID: 12460602
0
 
LVL 7

Author Comment

by:brdrok
ID: 12463367
thanks for the help.  i suppose creating a dataview is the way to go about this.  still was somehow hoping to implement the IList interface to my DictionaryBase collection class but appearantly I am still too dumb :(

Was trying to ge the best of both worlds.  implement the IList so i can use it as a datasource for a datagrid, but I also like the key, value pair as well....  

anywho......thanks for all your help you two....


0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question