hytos / DTI_PID / SPPIDConverter_AutoModeling / UnitForm.cs @ c7a0bb20
이력 | 보기 | 이력해설 | 다운로드 (1.73 KB)
1 | aac983d3 | gaqhf | using System; |
---|---|---|---|
2 | using System.Collections.Generic; |
||
3 | using System.ComponentModel; |
||
4 | using System.Data; |
||
5 | using System.Drawing; |
||
6 | using System.Linq; |
||
7 | using System.Text; |
||
8 | using System.Threading.Tasks; |
||
9 | using System.Windows.Forms; |
||
10 | using DevExpress.XtraTreeList; |
||
11 | using DevExpress.XtraTreeList.Nodes; |
||
12 | |||
13 | namespace SPPIDConverter_AutoModeling |
||
14 | { |
||
15 | public partial class UnitForm : DevExpress.XtraBars.Ribbon.RibbonForm |
||
16 | { |
||
17 | DataTable dUnit; |
||
18 | public string SelectedUnit { get; set; } |
||
19 | |||
20 | public UnitForm(DataTable dUnit) |
||
21 | { |
||
22 | InitializeComponent(); |
||
23 | this.dUnit = dUnit; |
||
24 | InitTreeList(); |
||
25 | } |
||
26 | |||
27 | public void InitTreeList() |
||
28 | { |
||
29 | treeList1.DataSource = dUnit; |
||
30 | treeList1.KeyFieldName = "SP_ID"; |
||
31 | treeList1.ParentFieldName = "PARENTID"; |
||
32 | treeList1.OptionsView.ShowIndicator = false; |
||
33 | treeList1.OptionsView.ShowColumns = false; |
||
34 | treeList1.OptionsView.ShowHorzLines = false; |
||
35 | treeList1.OptionsView.ShowVertLines = false; |
||
36 | treeList1.OptionsView.FocusRectStyle = DrawFocusRectStyle.None; |
||
37 | treeList1.OptionsBehavior.Editable = false; |
||
38 | |||
39 | treeList1.ExpandAll(); |
||
40 | } |
||
41 | |||
42 | private void treeList1_DoubleClick(object sender, EventArgs e) |
||
43 | { |
||
44 | TreeList tree = sender as TreeList; |
||
45 | TreeListHitInfo hit = tree.CalcHitInfo(tree.PointToClient(Control.MousePosition)); |
||
46 | if (hit.Node != null) |
||
47 | { |
||
48 | TreeListNode node = hit.Node; |
||
49 | if (node.Level == 2) |
||
50 | { |
||
51 | SelectedUnit = node.GetValue("NAME").ToString(); |
||
52 | DialogResult = DialogResult.OK; |
||
53 | } |
||
54 | } |
||
55 | } |
||
56 | } |
||
57 | } |