-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForm1.cs
More file actions
65 lines (58 loc) · 1.98 KB
/
Form1.cs
File metadata and controls
65 lines (58 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraVerticalGrid.Rows;
namespace AddRowsRuntime {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e) {
propertyGridControl1.AutoGenerateRows = false;
CreateRows();
Person person = new Person();
person.LastName = "Doe";
person.FirstName = "John";
propertyGridControl1.SelectedObject = person;
}
private void CreateRows() {
EditorRow rowLastName = new EditorRow("LastName");
rowLastName.Properties.Caption = "Last name";
propertyGridControl1.Rows.Add(rowLastName);
CategoryRow rowCategory = new CategoryRow("Address");
propertyGridControl1.Rows.Add(rowCategory);
EditorRow rowAddressLine1 = new EditorRow("AddressLine1");
rowAddressLine1.Properties.Caption = "Address Line 1";
rowCategory.ChildRows.Add(rowAddressLine1);
EditorRow rowZip = new EditorRow("Zip");
rowZip.Properties.Caption = "Zip Code";
rowCategory.ChildRows.Add(rowZip);
}
}
public class Person {
private string _FirstName;
public string FirstName {
get { return _FirstName; }
set { _FirstName = value; }
}
private string _LastName;
public string LastName {
get { return _LastName; }
set { _LastName = value; }
}
private string _AddressLine1;
public string AddressLine1 {
get { return _AddressLine1; }
set { _AddressLine1 = value; }
}
private string _Zip;
public string Zip {
get { return _Zip; }
set { _Zip = value; }
}
}
}