This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
/
Main.cs
70 lines (60 loc) · 2.14 KB
/
Main.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraBars.Helpers;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;
using DevExpress.XtraBars.Ribbon;
namespace Rolodex {
public partial class Main : RibbonForm {
public Main() {
InitializeComponent();
InitSkinGallery();
}
void InitSkinGallery() {
SkinHelper.InitSkinGallery(rgbiSkins, true);
}
private void Main_Load(object sender, EventArgs e) {
this.contactTableAdapter.Fill(this.rolodexDataSet.Contact);
}
private void iExit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
Close();
}
private void SelectedIndexChanged(object sender, EventArgs e) {
switch (radioGroup.SelectedIndex) {
case 0:
grid.MainView = view;
break;
case 1:
grid.MainView = layout;
break;
}
}
private void iFind_DownChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
view.OptionsFind.AlwaysVisible = iFind.Down;
layout.OptionsFind.AlwaysVisible = iFind.Down;
}
private void ViewRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) {
DataRow row = (DataRow)view.GetFocusedDataRow();
if (row != null) {
siStatus.Caption = (String)row["Email"];
} else {
siStatus.Caption = String.Empty;
}
}
private void LayoutRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) {
DataRow row = (DataRow)layout.GetFocusedDataRow();
if (row != null) {
siStatus.Caption = (String)row["Email"];
} else {
siStatus.Caption = String.Empty;
}
}
}
}