Solved

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

Posted on 2014-12-16
2
127 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction You may have a need to setup a group of users to allow local administrative access on workstations.  In a domain environment this can easily be achieved with Restricted Groups and Group Policies. This article will demonstrate how to…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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 configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

706 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

18 Experts available now in Live!

Get 1:1 Help Now