-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDefault.aspx.cs
More file actions
40 lines (34 loc) · 1.46 KB
/
Default.aspx.cs
File metadata and controls
40 lines (34 loc) · 1.46 KB
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web;
namespace Test {
public partial class Default : Page {
String ModificationErrorText {
get {
return
"Data modifications are not supplied by this demo.";
}
}
protected void dataSource_Modifying(object sender, SqlDataSourceCommandEventArgs e) {
e.Cancel = true;
throw new NotSupportedException(ModificationErrorText);
}
protected void btnEdit_Init(object sender, EventArgs e) {
var btn = (sender as ASPxButton);
var nc = btn.NamingContainer as GridViewDataItemTemplateContainer;
btn.ClientSideEvents.Click = String.Format("function() {{ grid.StartEditRow({0}); }}", nc.VisibleIndex);
}
protected void btnDelete_Init(object sender, EventArgs e) {
var btn = (sender as ASPxButton);
var nc = btn.NamingContainer as GridViewDataItemTemplateContainer;
btn.ClientSideEvents.Click = String.Format("function() {{ grid.DeleteRow({0}); }}", nc.VisibleIndex);
}
protected void cmbxEditForm_SelectedIndexChanged(object sender, EventArgs e) {
var editMode = (GridViewEditingMode)Enum.Parse(typeof(GridViewEditingMode), cmbxEditForm.Value.ToString());
grid.SettingsEditing.Mode = editMode;
}
}
}