Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Item
- ----------------
- Joe Bloggs
- George Forman
- Peter Pan
- NAME EMAIL
- ------------------------------------------------------
- Joe Bloggs joe@bloggs.com
- George Forman george@formangrills.co
- Peter Pan me@neverland.com
- // Where List is instantiated
- List<List<string>> list2d = new List<List<string>>
- ...
- // Where DataGrid instance is given the list
- dg.DataSource = list2d;
- dg.DataBind();
- ...
- // In another method, where all people add their names and emails, then are added
- // to the two-dimensional list
- foreach (People p in ppl.results) {
- list.Add(results.name);
- list.Add(results.email);
- list2d.Add(list);
- }
- Capacity Count
- ----------------
- 16 16
- 16 16
- 16 16
- ... ...
- public class Person {
- public string Name {get; set;}
- public string Email {get; set;}
- }
- var people = new List<Person>();
- foreach (People p in ppl.results) {
- list.Add(results.name);
- list.Add(results.email);
- list2d.Add(list);
- }
- foreach (People p in ppl.results) {
- var list = new List<string>();
- list.Add(p.name);
- list.Add(p.email);
- list2d.Add(list);
- }
Add Comment
Please, Sign In to add comment