-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXtraReport1.cs
43 lines (35 loc) · 1.47 KB
/
XtraReport1.cs
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
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraReports.Parameters;
namespace WindowsFormsApp1 {
public partial class XtraReport1 : DevExpress.XtraReports.UI.XtraReport {
public XtraReport1() {
InitializeComponent();
}
private void XtraReport1_ParametersRequestBeforeShow(object sender, ParametersRequestEventArgs e) {
// Create and set up a radio group editor.
var radioGroup = CreateRadioGroup();
// Find a required parameter by name and assign
// a custom editor to the Editor property.
foreach (var info in e.ParametersInformation) {
if (info.Parameter.Name == "shape") {
info.Editor = radioGroup;
break;
}
}
}
private RadioGroup CreateRadioGroup() {
var radioGroup = new RadioGroup();
string[] radioGroupItemTitles = new string[] {
"Circle", "Rectangle", "Ellipse",
"Triangle", "Square"
};
foreach (var item in radioGroupItemTitles) {
radioGroup.Properties.Items.Add(new RadioGroupItem(item, item));
}
radioGroup.Properties.ItemVertAlignment = RadioItemVertAlignment.Top;
radioGroup.MinimumSize = new System.Drawing.Size(0, 100);
return radioGroup;
}
}
}