Solved

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

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
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.

820 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