Solved

After getting list<DirectoryEntry>, how do I bind to Grid control?

Posted on 2014-12-16
2
135 Views
Last Modified: 2014-12-20
Hi, I'm using VS2012, asp.net and C#.
I need to allow users to edit just a couple of columns data in this grid.  Is Grid control the best one to use for this purpose?

After retrieving a user group, I want to list each users(some attribute information about each user) in this grid control.  My code uses generic collection or maybe I should use array?  How can I bind the grid data source to all users object I retrieved?  Example code or url?  Thank you.

List<DirectoryEntry> genericAccounts = new List<DirectoryEntry>();
                    foreach (object groupMember in (IEnumerable<object>)members)
                    {
                        DirectoryEntry member = new DirectoryEntry(groupMember);
                        genericAccounts.Add(member);

                    }
0
Comment
Question by:lapucca
[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
2 Comments
 
LVL 56

Accepted Solution

by:
HainKurt earned 500 total points
ID: 40503980
try

GridView.DataSource = genericAccounts
GridView.DataBind()
0
 

Author Closing Comment

by:lapucca
ID: 40511219
Thank you.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Here's a look at newsworthy articles and community happenings during the last month.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Suggested Courses

624 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