Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-12-16
2
Medium Priority
?
136 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 59

Accepted Solution

by:
HainKurt earned 2000 total points
ID: 40503980
try

GridView.DataSource = genericAccounts
GridView.DataBind()
0
 

Author Closing Comment

by:lapucca
ID: 40511219
Thank you.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

A hard and fast method for reducing Active Directory Administrators members.
Here's a look at newsworthy articles and community happenings during the last month.
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…
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.

670 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