EveryDB2のデータベースを読み込んでWinFormでGUI表示するサンプル
Revision | de41042120edf366140a993e90979c9d01f517c0 (tree) |
---|---|
Zeit | 2021-06-01 05:07:52 |
Autor | yoshy <yoshy@user...> |
Commiter | yoshy |
temp_20210601_0507
@@ -47,9 +47,56 @@ namespace UmaTest.App.Adaptor.Gateway.ViewModel.Dto | ||
47 | 47 | |
48 | 48 | public string SenSuu { get; set; } |
49 | 49 | |
50 | - public string ChichiBamei { get => Konso != null ? Konso.Chichi.Bamei : String.Empty; } | |
50 | + public NHansyoku Chichi | |
51 | + { | |
52 | + get | |
53 | + { | |
54 | + if (Konso != null) | |
55 | + { | |
56 | + return Konso.Chichi; | |
57 | + } | |
58 | + if (Zenso != null) | |
59 | + { | |
60 | + return Zenso.Chichi; | |
61 | + } | |
62 | + | |
63 | + return null; | |
64 | + } | |
65 | + } | |
51 | 66 | |
52 | - public string HahaChichiBamei { get => Konso?.HahaChichi.Bamei; } | |
67 | + public NHansyoku HahaChichi | |
68 | + { | |
69 | + get | |
70 | + { | |
71 | + if (Konso != null) | |
72 | + { | |
73 | + return Konso.HahaChichi; | |
74 | + } | |
75 | + if (Zenso != null) | |
76 | + { | |
77 | + return Zenso.HahaChichi; | |
78 | + } | |
79 | + | |
80 | + return null; | |
81 | + } | |
82 | + } | |
83 | + | |
84 | + public string BataijyuFormatted | |
85 | + { | |
86 | + get | |
87 | + { | |
88 | + if (Konso != null) | |
89 | + { | |
90 | + return Konso.BataijyuFormatted; | |
91 | + } | |
92 | + if (Zenso != null) | |
93 | + { | |
94 | + return Zenso.BataijyuFormatted; | |
95 | + } | |
96 | + | |
97 | + return String.Empty; | |
98 | + } | |
99 | + } | |
53 | 100 | |
54 | 101 | public UmaRaceRowDto Konso { get; set; } |
55 | 102 |
@@ -127,18 +127,18 @@ namespace UmaTest.App.Presentation.View | ||
127 | 127 | new DataGridViewTextBoxColumn |
128 | 128 | { |
129 | 129 | //DataPropertyName = "ChichiBamei", |
130 | - DataPropertyName = "Konso.Chichi.Bamei", | |
130 | + DataPropertyName = "Chichi.Bamei", | |
131 | 131 | Name = "父", |
132 | 132 | }, |
133 | 133 | new DataGridViewTextBoxColumn |
134 | 134 | { |
135 | 135 | //DataPropertyName = "HahaChichiBamei", |
136 | - DataPropertyName = "Konso.HahaChichi.Bamei", | |
136 | + DataPropertyName = "HahaChichi.Bamei", | |
137 | 137 | Name = "母父", |
138 | 138 | }, |
139 | 139 | new DataGridViewTextBoxColumn |
140 | 140 | { |
141 | - DataPropertyName = "Konso.BataijyuFormatted", | |
141 | + DataPropertyName = "BataijyuFormatted", | |
142 | 142 | Name = "馬体重", |
143 | 143 | }, |
144 | 144 | new DataGridViewTextBoxColumn |
@@ -368,6 +368,12 @@ namespace UmaTest.App.Presentation.View | ||
368 | 368 | typeof(UmaRaceInfo) |
369 | 369 | ); |
370 | 370 | |
371 | + // 馬サマリ行.繁殖馬情報 | |
372 | + TypeDescriptor.AddProvider( | |
373 | + new NestedTypeDescriptionProvider<NHansyoku>(TypeDescriptor.GetProvider(typeof(UmaSummaryRowDto))), | |
374 | + typeof(UmaSummaryRowDto) | |
375 | + ); | |
376 | + | |
371 | 377 | // 馬サマリ行.着度数 |
372 | 378 | TypeDescriptor.AddProvider( |
373 | 379 | new NestedTypeDescriptionProvider<ChakudosuuByGradeRowDto>(TypeDescriptor.GetProvider(typeof(UmaSummaryRowDto))), |
@@ -382,11 +388,6 @@ namespace UmaTest.App.Presentation.View | ||
382 | 388 | nestedUmaRaceRowDtoProvider, typeof(UmaSummaryRowDto) |
383 | 389 | ); |
384 | 390 | |
385 | - // 馬サマリ行.馬毎レース行.繁殖馬情報 | |
386 | - TypeDescriptor.AddProvider( | |
387 | - new NestedTypeDescriptionProvider<NHansyoku>(nestedUmaRaceRowDtoProvider), typeof(UmaSummaryRowDto) | |
388 | - ); | |
389 | - | |
390 | 391 | // |
391 | 392 | // Enable Double Buffering for repainting too slow problem on data grid view |
392 | 393 | // |
@@ -428,6 +429,11 @@ namespace UmaTest.App.Presentation.View | ||
428 | 429 | bindingSource1.DataSource = vm.UmaSummaryList; |
429 | 430 | AdjustDataGridView(dataGridView1, bindingSource1, vm.UmaSummaryList.Count, splitContainer2.Panel1); |
430 | 431 | |
432 | + if (dataGridView1.Rows.Count > 0) | |
433 | + { | |
434 | + dataGridView1.Rows[0].Selected = true; | |
435 | + } | |
436 | + | |
431 | 437 | splitContainer2.FixedPanel = FixedPanel.None; |
432 | 438 | int newHeight = dataGridView1.ColumnHeadersHeight |
433 | 439 | + (dataGridView1.Rows.Count > 0 ? dataGridView1.Rows.Count * dataGridView1.Rows[0].Height : 0) |