Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace Service
  7. {
  8. public class Layer
  9. {
  10. public string Name { get; set; }
  11. public string Title { get; set; }
  12. public string Abstract { get; set; }
  13. public bool Selected { get; set; }
  14. public List<string> CRS = new List<string>();
  15. public List<string> Styles = new List<string>();
  16.  
  17. }
  18. }
  19.  
  20. //Method Inside of presenter to provide datagridview with values
  21. public void ProvideLayers()
  22. {
  23. if (_lview != null && _layers != null)
  24. {
  25.  
  26. foreach (Layer lay in _layers)
  27. {
  28. if (lay.Styles.Count == 0)
  29. {
  30. _lview.AddRow(lay.Title,new List<string>());
  31. continue;
  32. }
  33. else
  34. {
  35. _lview.AddRow(lay.Title,lay.Styles);
  36. }
  37.  
  38. }
  39.  
  40. }
  41.  
  42. }
  43.  
  44. public void AddRow(string lName,List<string> lStyles)
  45. {
  46. dataGridView1.Rows.Add(lName,lStyles);
  47. }
  48.  
  49. public void AddRow(string lName,List<string> lStyles)
  50. {
  51. var dgvRow = new DataGridViewRow();
  52.  
  53. dgvRow.Cells.Add(new DataGridViewTextBoxCell());
  54. dgvRow.Cells.Add(new DataGridViewComboBoxCell());
  55.  
  56. dgvRow.Cells[0].Value = lName;
  57.  
  58. ((DataGridViewComboBoxCell) dgvRow.Cells[1]).DataSource = lStyles;
  59.  
  60. dataGridView1.Rows.Add(dgvRow);
  61. }
  62.  
  63. dataGridView1.Columns.Add(new DataGridViewTextBoxColumn());
  64. dataGridView1.Columns.Add(new DataGridViewComboBoxColumn());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement