Solved

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

Posted on 2014-12-16
2
128 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
2 Comments
 
LVL 51

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

Does Powershell have you tied up in knots?

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

Suggested Solutions

Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

948 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now