Skip to content

Commit cd4ee2a

Browse files
Merge pull request #1 from SindhuTN/master
Samples has been committed.
2 parents e7062fd + 0859fbf commit cd4ee2a

17 files changed

+1275
-2
lines changed

Data.cs

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
#region Copyright Syncfusion Inc. 2001 - 2014
2+
// Copyright Syncfusion Inc. 2001 - 2014. All rights reserved.
3+
// Use of this code is subject to the terms of our license.
4+
// A copy of the current license can be obtained at any time by e-mailing
5+
// licensing@syncfusion.com. Any infringement will be prosecuted under
6+
// applicable laws.
7+
#endregion
8+
using System;
9+
10+
namespace DataGrid
11+
{
12+
/// <summary>
13+
/// Summary description for Data.
14+
/// </summary>
15+
public class Data
16+
{
17+
public Data() : this("", "", "","","","","")
18+
{
19+
}
20+
21+
public Data(string cat_Id, string cat_Name, string desc,string sample_Data,string value,string edit, string delete)
22+
{
23+
this.cat_Id = cat_Id;
24+
this.cat_Name = cat_Name;
25+
this.desc = desc;
26+
this.sample_Data = sample_Data;
27+
this.value = value;
28+
this.edit = edit;
29+
this.delete = delete;
30+
}
31+
private string cat_Name;
32+
public string CategoryName
33+
{
34+
get
35+
{
36+
return this.cat_Name;
37+
}
38+
set
39+
{
40+
this.cat_Name = value;
41+
}
42+
}
43+
private string cat_Id;
44+
public string CategoryID
45+
{
46+
get
47+
{
48+
return this.cat_Id;
49+
}
50+
set
51+
{
52+
this.cat_Id = value;
53+
}
54+
}
55+
private string desc;
56+
public string Description
57+
{
58+
get
59+
{
60+
return this.desc;
61+
}
62+
set
63+
{
64+
this.desc = value;
65+
}
66+
}
67+
private string sample_Data;
68+
public string SampleData
69+
{
70+
get
71+
{
72+
return this.sample_Data;
73+
}
74+
set
75+
{
76+
this.sample_Data = value;
77+
}
78+
}
79+
private string value;
80+
public string Value
81+
{
82+
get
83+
{
84+
return this.value;
85+
}
86+
set
87+
{
88+
this.value = value;
89+
}
90+
}
91+
private string edit;
92+
public string Edit
93+
{
94+
get
95+
{
96+
return this.edit;
97+
}
98+
set
99+
{
100+
this.edit = value;
101+
}
102+
}
103+
private string delete;
104+
public string Delete
105+
{
106+
get
107+
{
108+
return this.delete;
109+
}
110+
set
111+
{
112+
this.delete = value;
113+
}
114+
}
115+
116+
}
117+
}

DataCollection.cs

Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
#region Copyright Syncfusion Inc. 2001 - 2014
2+
// Copyright Syncfusion Inc. 2001 - 2014. All rights reserved.
3+
// Use of this code is subject to the terms of our license.
4+
// A copy of the current license can be obtained at any time by e-mailing
5+
// licensing@syncfusion.com. Any infringement will be prosecuted under
6+
// applicable laws.
7+
#endregion
8+
using System;
9+
using System.Collections;
10+
using System.ComponentModel;
11+
using System.Data;
12+
13+
14+
namespace DataGrid
15+
{
16+
/// <summary>
17+
/// Summary description for DataCollection.
18+
/// </summary>
19+
public class DataCollection : IBindingList, INotifyPropertyChanged
20+
{
21+
private ArrayList list;
22+
23+
public DataCollection()
24+
{
25+
list = new ArrayList();
26+
}
27+
28+
public Data this[int index]
29+
{
30+
get
31+
{
32+
return (Data)list[index];
33+
}
34+
set
35+
{
36+
list[index] = value;
37+
RaisePropertyChanged(list[index].ToString());
38+
}
39+
}
40+
41+
void RaisePropertyChanged(string name)
42+
{
43+
if (PropertyChanged != null)
44+
PropertyChanged(this, new PropertyChangedEventArgs(name));
45+
}
46+
47+
#region INotifyPropertyChanged Members
48+
49+
public event PropertyChangedEventHandler PropertyChanged;
50+
51+
#endregion
52+
53+
#region IBindingList Members
54+
55+
public void AddIndex(PropertyDescriptor property)
56+
{
57+
}
58+
59+
public bool AllowNew
60+
{
61+
get
62+
{
63+
return true;
64+
}
65+
}
66+
67+
public void ApplySort(PropertyDescriptor property, System.ComponentModel.ListSortDirection direction)
68+
{
69+
}
70+
71+
public PropertyDescriptor SortProperty
72+
{
73+
get
74+
{
75+
return null;
76+
}
77+
}
78+
79+
public int Find(PropertyDescriptor property, object key)
80+
{
81+
return 0;
82+
}
83+
84+
public bool SupportsSorting
85+
{
86+
get
87+
{
88+
return false;
89+
}
90+
}
91+
92+
public bool IsSorted
93+
{
94+
get
95+
{
96+
return false;
97+
}
98+
}
99+
100+
public bool AllowRemove
101+
{
102+
get
103+
{
104+
return false;
105+
}
106+
}
107+
108+
public bool SupportsSearching
109+
{
110+
get
111+
{
112+
return false;
113+
}
114+
}
115+
116+
public System.ComponentModel.ListSortDirection SortDirection
117+
{
118+
get
119+
{
120+
return new System.ComponentModel.ListSortDirection ();
121+
}
122+
}
123+
public event System.ComponentModel.ListChangedEventHandler ListChanged;
124+
public bool SupportsChangeNotification
125+
{
126+
get
127+
{
128+
return true;
129+
}
130+
}
131+
132+
public void RemoveSort()
133+
{
134+
}
135+
136+
public object AddNew()
137+
{
138+
Data info = new Data();
139+
this.list.Add(info);
140+
return info;
141+
}
142+
143+
public bool AllowEdit
144+
{
145+
get
146+
{
147+
return true;
148+
}
149+
}
150+
151+
public void RemoveIndex(PropertyDescriptor property)
152+
{
153+
}
154+
155+
#endregion
156+
157+
#region IList Members
158+
159+
public bool IsReadOnly
160+
{
161+
get
162+
{
163+
return false;
164+
}
165+
}
166+
167+
object IList.this[int index]
168+
{
169+
get
170+
{
171+
return list[index];
172+
}
173+
set
174+
{
175+
list[index] = value;
176+
}
177+
}
178+
179+
public void RemoveAt(int index)
180+
{
181+
list.RemoveAt(index);
182+
RaiseListChanged(ListChangedType.ItemDeleted, index);
183+
}
184+
185+
public void Insert(int index, object value)
186+
{
187+
list.Insert(index, value);
188+
RaiseListChanged(ListChangedType.ItemAdded, index);
189+
}
190+
191+
public void Remove(object value)
192+
{
193+
int index = list.IndexOf(value);
194+
list.Remove(value);
195+
RaiseListChanged(ListChangedType.ItemDeleted, index);
196+
}
197+
198+
public bool Contains(object value)
199+
{
200+
return list.Contains(value);
201+
}
202+
203+
public void Clear()
204+
{
205+
list.Clear();
206+
}
207+
208+
public int IndexOf(object value)
209+
{
210+
return list.IndexOf(value);
211+
}
212+
213+
public int Add(object value)
214+
{
215+
int count = list.Add(value);
216+
RaiseListChanged(ListChangedType.ItemAdded, list.Count-1);
217+
return count;
218+
}
219+
220+
public bool IsFixedSize
221+
{
222+
get
223+
{
224+
return false;
225+
}
226+
}
227+
228+
void RaiseListChanged(ListChangedType type, int index)
229+
{
230+
if (ListChanged != null)
231+
ListChanged(this, new ListChangedEventArgs(type, index));
232+
}
233+
234+
#endregion
235+
236+
237+
#region ICollection Members
238+
239+
public bool IsSynchronized
240+
{
241+
get
242+
{
243+
return false;
244+
}
245+
}
246+
247+
public int Count
248+
{
249+
get
250+
{
251+
return list.Count;
252+
}
253+
}
254+
255+
public void CopyTo(Array array, int index)
256+
{
257+
list.CopyTo(array, index);
258+
}
259+
260+
public object SyncRoot
261+
{
262+
get
263+
{
264+
return list.SyncRoot;
265+
}
266+
}
267+
268+
#endregion
269+
270+
#region IEnumerable Members
271+
272+
public IEnumerator GetEnumerator()
273+
{
274+
return list.GetEnumerator();
275+
}
276+
277+
#endregion
278+
}
279+
}

0 commit comments

Comments
 (0)