-
Notifications
You must be signed in to change notification settings - Fork 0
/
GridViewEx.cs
41 lines (35 loc) · 1.64 KB
/
GridViewEx.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
using DevExpress.Data;
using DevExpress.Utils.Controls;
using DevExpress.Utils.Serializing;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Base;
using DevExpress.XtraGrid.Views.Grid;
using System;
using System.ComponentModel;
namespace DxSample.Grid {
public class GridViewEx :GridView {
public GridViewEx() : base() { }
public GridViewEx(GridControl ownerGrid) : base(ownerGrid) { }
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content), XtraSerializableProperty(XtraSerializationVisibility.Content)]
public new GridViewExOptionsBehavior OptionsBehavior {
get { return (GridViewExOptionsBehavior)base.OptionsBehavior; }
}
protected override ColumnViewOptionsBehavior CreateOptionsBehavior() {
return new GridViewExOptionsBehavior(this);
}
protected override BaseGridController CreateDataController() {
if (requireDataControllerType == DataControllerType.Regular)
return new CancellingChangesDataController();
return base.CreateDataController();
}
protected override string OnCreateLookupDisplayFilter(string text, string displayMember) {
throw new NotSupportedException("This view cannot be used in lookup editors");
}
protected override void UpdateDataControllerOptions() {
base.UpdateDataControllerOptions();
CancellingChangesDataController controller = DataController as CancellingChangesDataController;
if (controller != null)
controller.CanCancelChanges = OptionsBehavior.CanCancelChanges;
}
}
}