Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace Service
- {
- public class Layer
- {
- public string Name { get; set; }
- public string Title { get; set; }
- public string Abstract { get; set; }
- public bool Selected { get; set; }
- public List<string> CRS = new List<string>();
- public List<string> Styles = new List<string>();
- }
- }
- //Method Inside of presenter to provide datagridview with values
- public void ProvideLayers()
- {
- if (_lview != null && _layers != null)
- {
- foreach (Layer lay in _layers)
- {
- if (lay.Styles.Count == 0)
- {
- _lview.AddRow(lay.Title,new List<string>());
- continue;
- }
- else
- {
- _lview.AddRow(lay.Title,lay.Styles);
- }
- }
- }
- }
- public void AddRow(string lName,List<string> lStyles)
- {
- dataGridView1.Rows.Add(lName,lStyles);
- }
- public void AddRow(string lName,List<string> lStyles)
- {
- var dgvRow = new DataGridViewRow();
- dgvRow.Cells.Add(new DataGridViewTextBoxCell());
- dgvRow.Cells.Add(new DataGridViewComboBoxCell());
- dgvRow.Cells[0].Value = lName;
- ((DataGridViewComboBoxCell) dgvRow.Cells[1]).DataSource = lStyles;
- dataGridView1.Rows.Add(dgvRow);
- }
- dataGridView1.Columns.Add(new DataGridViewTextBoxColumn());
- dataGridView1.Columns.Add(new DataGridViewComboBoxColumn());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement