Example #1
0
        private void addTemplateButton_Click(object sender, EventArgs e)
        {
            var view = new TemplateView(new EntryTemplate()) { ImageList = templateImages };
            _templateViews.Add(view);

            //immediately select the new view
            var row = templateDataGridView.Rows.Cast<DataGridViewRow>().First(dgvr => dgvr.DataBoundItem == view);
            templateDataGridView.CurrentCell = row.Cells[0];    //setting this property updates the bindingsource's current prop
            templateName.Focus();
        }
Example #2
0
        private void LoadExistingTemplates()
        {
            _database.RefreshTemplates();

            foreach (var template in _database.Templates.OrderBy(t => t.Name))
            {
                var view = new TemplateView(template) { ImageList = templateImages };
                _templateViews.Add(view);
            }
        }