Speedj's Posts
Nairaland Forum › Speedj's Profile › Speedj's Posts
1 (of 1 pages)
cylife:this is simply done by the use of dapfor.Net Grid. check the code below //Add a dictionary to a grid IDictionary<string, object> dataObject1 = new Dictionary<string, object>(); dataObject1.Add("IntValue", 10); dataObject1.Add("StringValue", "some string 1" ;grid.Rows.Add(dataObject1); |
cylife:i use "dapfor.Net Grid" When data is modified, the programmer has to inform the grid about it using Row.Update() method. When event-driven model is used, the grid can receive and process notifications from INotifyPropertyChanged or IBindingList interfaces. In such scenario, when the grid receives notification and performs multi-threading synchronization (if needed), the grid automatically calls Row.Update() method for a corresponding row. class Employee : INotifyPropertyChanged { private readonly string _name; private string _department; private readonly string _position; public Employee(string name, string department, string position) { _name = name; _department = department; _position = position; } public string Name { get { return _name; } } public string Department { get { return _department; } set { if(_department != value) { _department = value; if(PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs("Department" );} } } } public string Position { get { return _position; } } public event PropertyChangedEventHandler PropertyChanged; |
cylife:with the help of dapfor.netgrid. A programmer may create any arbitrary classes in application. Objects of these classes are associated with grid rows, and their properties are associated with grid columns. Values returned by getters of these properties are displayed in grid cells.check the codes below public class MyCustomClass { private int _intValue; private double _doubleValue; private string _stringValue; public MyCustomClass(int intValue, double doubleValue, string stringValue) { _intValue = intValue; _doubleValue = doubleValue; _stringValue = stringValue; } public int IntValue { get { return _intValue; } set { _intValue = value; } } public double DoubleValue { get { return _doubleValue; } set { _doubleValue = value; } } public string StringValue { get { return _stringValue; } set { _stringValue = value; } } } title public class MyCustomClass { private int _intValue; private double _doubleValue; private string _stringValue; public MyCustomClass(int intValue, double doubleValue, string stringValue) { _intValue = intValue; _doubleValue = doubleValue; _stringValue = stringValue; } public int IntValue { get { return _intValue; } set { _intValue = value; } } public double DoubleValue { get { return _doubleValue; } set { _doubleValue = value; } } public string StringValue { get { return _stringValue; } set { _stringValue = value; } } } |
1 (of 1 pages)
;