Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Windows.Forms;
- namespace ObjectModel
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- ultraGrid1.MouseClick += UltraGrid1OnMouseClick;
- }
- private void UltraGrid1OnMouseClick(object sender, MouseEventArgs mouseEventArgs)
- {
- if (mouseEventArgs.Button == MouseButtons.Right)
- ultraGrid1.ShowColumnChooser();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- List<Parent> parents = new List<Parent>();
- parents.Add(new Parent());
- parents.Add(new Parent());
- parents.Add(new Parent());
- ultraGrid1.DataSource = parents;
- }
- }
- [DisplayName("ParentDisplayName")]
- public class Parent
- {
- private List<Child> children = new List<Child>();
- public Parent()
- {
- children.Add(new Child());
- children.Add(new Child());
- }
- [Browsable(true)]
- public IEnumerable<Child> Children { get { return children; } }
- public int ParentValueBrowsable { get; }
- [Browsable(false)]
- public int ParentValueNotBrowsable { get; }
- }
- public class Child
- {
- [Browsable(false)]
- public Parent Parent { get; }
- [Browsable(false)]
- public int ChildValueNotBrowsable{ get; }
- [Browsable(true)]
- public int ChildValueBrowsable { get; }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement