개정판 8be944e6
issue #0000 상단 search 추가
ID2.Manager/ID2.Manager/Main.cs | ||
---|---|---|
27 | 27 |
|
28 | 28 |
using Newtonsoft.Json; |
29 | 29 |
using System.Diagnostics; |
30 |
using Telerik.WinControls.RadControlSpy; |
|
30 | 31 |
|
31 | 32 |
namespace ID2.Manager |
32 | 33 |
{ |
... | ... | |
45 | 46 |
|
46 | 47 |
this.Initialize(); |
47 | 48 |
|
49 |
//RadControlSpyForm radControlSpyForm = new RadControlSpyForm(); |
|
50 |
//radControlSpyForm.Show(); |
|
51 |
|
|
48 | 52 |
SpreadsheetInfo.SetLicense(Properties.Settings.Default.GemBoxLicense); |
49 | 53 |
|
50 | 54 |
this.Load += Main_Load; |
... | ... | |
68 | 72 |
this.radGridViewDocuments.MasterView.TableHeaderRow.MinHeight = 36; |
69 | 73 |
this.radGridViewDocuments.TableElement.RowHeaderColumnWidth = 36; |
70 | 74 |
|
75 |
|
|
71 | 76 |
var openProjectView = new OpenProjectView() |
72 | 77 |
{ |
73 | 78 |
Dock = DockStyle.Fill |
... | ... | |
111 | 116 |
private void Main_Load(object sender, EventArgs e) |
112 | 117 |
{ |
113 | 118 |
this.radGridViewDocuments.DataSource = this.documents; |
119 |
|
|
120 |
InitializeSearch(); |
|
121 |
} |
|
122 |
|
|
123 |
private void InitializeSearch() |
|
124 |
{ |
|
125 |
lbSearch.Text = "\ue13E"; |
|
126 |
btnSearchNext.Text = "\ue006"; |
|
127 |
btnSearchPrevious.Text = "\ue004"; |
|
128 |
btnFilterColumns.Text = "\ue13A"; |
|
129 |
|
|
130 |
var chkbox = new RadCheckBoxElement(); |
|
131 |
chkbox.Text = "Match Case"; |
|
132 |
chkbox.CheckStateChanged += (snd, evt) => { radGridViewDocuments.MasterView.TableSearchRow.CaseSensitive = chkbox.Checked; }; |
|
133 |
|
|
134 |
btnMatchCase.HostedItem = chkbox; |
|
135 |
|
|
136 |
var chkbox2 = new RadCheckBoxElement(); |
|
137 |
chkbox2.Text = "Search from current position"; |
|
138 |
chkbox2.CheckStateChanged += (snd, evt) => { radGridViewDocuments.MasterView.TableSearchRow.SearchFromCurrentPosition = chkbox.Checked; }; |
|
139 |
|
|
140 |
btnSearchFormCurrent.HostedItem = chkbox2; |
|
141 |
|
|
142 |
var columns = radGridViewDocuments.Columns.Where(x=> x.AllowSearching).Select(x => |
|
143 |
new FilterColumn |
|
144 |
{ |
|
145 |
Name = x.HeaderText, |
|
146 |
FieldName = x.FieldName, |
|
147 |
IsSelect = x.AllowSearching |
|
148 |
}); |
|
149 |
|
|
150 |
var panel = new StackLayoutElement(); |
|
151 |
panel.Orientation = Orientation.Vertical; |
|
152 |
|
|
153 |
var btnSelect = new RadCheckBoxElement { Text = "Select All", Checked = true, AccessibleDescription = "SelectAll" }; |
|
154 |
|
|
155 |
var btnComboColumns = new RadCheckedDropDownListElement(); |
|
156 |
btnComboColumns.ShowCheckAllItems = true; |
|
157 |
btnComboColumns.CheckAllItem.Checked = true; |
|
158 |
|
|
159 |
btnComboColumns.AutoCompleteEditableAreaElement.NullText = "Search in Columns"; |
|
160 |
btnComboColumns.AutoCompleteEditableAreaElement.AutoCompleteTextBox.IsReadOnly = true; |
|
161 |
|
|
162 |
//btnComboColumns.AutoCompleteDisplayMember = "Name"; |
|
163 |
|
|
164 |
btnComboColumns.DropDownMinSize = new Size(200, 200); |
|
165 |
btnComboColumns.DropDownSizingMode = SizingMode.UpDownAndRightBottom; |
|
166 |
//foreach (var item in columns) |
|
167 |
//{ |
|
168 |
// item.CheckStateChanged += (snd, evt) => { radGridViewDocuments.Columns[item.AccessibleDescription].AllowSearching = item.Checked; }; |
|
169 |
// btnFilterColumns.Items.Add(item); |
|
170 |
|
|
171 |
//} |
|
172 |
btnComboColumns.DisplayMember = "Name"; |
|
173 |
btnComboColumns.CheckedMember = "IsSelect"; |
|
174 |
btnComboColumns.ValueMember = "FieldName"; |
|
175 |
|
|
176 |
var font1 = ThemeResolutionService.GetCustomFont("TelerikWebUI"); |
|
177 |
btnComboColumns.TextBox.CustomFont = font1.Name; |
|
178 |
btnComboColumns.TextBox.Text = "\ue13A"; |
|
179 |
|
|
180 |
btnComboColumns.DataSource = columns; |
|
181 |
|
|
182 |
btnComboColumns.PopupClosed += (snd, evt) => |
|
183 |
{ |
|
184 |
foreach (RadCheckedListDataItem item in btnComboColumns.Items) |
|
185 |
{ |
|
186 |
radGridViewDocuments.Columns[item.Value.ToString()].AllowSearching = item.Checked; |
|
187 |
} |
|
188 |
}; |
|
189 |
//panel.Children.Add(btnSelect); |
|
190 |
//panel.Children.Add(new SeparatorElement()); |
|
191 |
//panel.Children.Add(btnComboColumns); |
|
192 |
btnFilters.HostedItem = btnComboColumns; |
|
114 | 193 |
} |
194 |
|
|
115 | 195 |
#endregion |
116 | 196 |
|
117 | 197 |
private void OpenProjectView_OpenProjectClick(object sender, EventArgs e) |
... | ... | |
1005 | 1085 |
if (this.OnWorkCompletedHandler != null) this.OnWorkCompletedHandler(); |
1006 | 1086 |
} |
1007 | 1087 |
} |
1088 |
|
|
1089 |
private void txtFullSearch_TextChanged(object sender, EventArgs e) |
|
1090 |
{ |
|
1091 |
txtFullSearch.TextBoxElement.ShowClearButton = !string.IsNullOrWhiteSpace(txtFullSearch.Text); |
|
1092 |
radGridViewDocuments.MasterView.TableSearchRow.Search(txtFullSearch.Text); |
|
1093 |
} |
|
1094 |
|
|
1095 |
private void btnSearchPrevious_Click(object sender, EventArgs e) |
|
1096 |
{ |
|
1097 |
|
|
1098 |
radGridViewDocuments.MasterView.TableSearchRow.SelectPreviousSearchResult(); |
|
1099 |
} |
|
1100 |
|
|
1101 |
private void btnSearchNext_Click(object sender, EventArgs e) |
|
1102 |
{ |
|
1103 |
radGridViewDocuments.MasterView.TableSearchRow.SelectNextSearchResult(); |
|
1104 |
} |
|
1008 | 1105 |
} |
1009 | 1106 |
} |
1107 |
|
|
1108 |
public class FilterColumn |
|
1109 |
{ |
|
1110 |
public string Name { get; set; } |
|
1111 |
public string FieldName { get; set; } |
|
1112 |
public bool IsSelect { get; set; } |
|
1113 |
} |
내보내기 Unified diff