1-) C# Devexpress Athena - realTimeSource1 kullanımı gridviewi refresh eder
using System;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Windows.Forms;
namespace Realtimesource {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
}
public class Ogrenci : INotifyPropertyChanged {
string _Id;
string _Adi;
public string Id {
get { return _Id; }
set {
_Id = value;
NotifyPropertyChanged("Id");
}
}
public string Adi {
get { return _Adi; }
set {
_Adi = value;
NotifyPropertyChanged("Adi");
}
}
public event PropertyChangedEventHandler PropertyChanged;
void NotifyPropertyChanged(string name) {
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
ObservableCollection<Ogrenci> Ogrenci1 = new ObservableCollection<Ogrenci>();
private void Form1_Load(object sender, EventArgs e) {
realTimeSource1.DataSource = Ogrenci1;
gridControl1.DataSource = realTimeSource1;
realTimeSource1.DisplayableProperties = "Id;Adi";
realTimeSource1.IgnoreItemEvents = true;
}
private void button1_Click(object sender, EventArgs e) {
Ogrenci1.Add(new Ogrenci() { Id = "4", Adi = "VELİ TEST"});
}
}
}