コード例 #1
0
 public static void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.GetType() == typeof(DateTime))
     {
         PropertyInfo dateTimePropertyInfo = sender.GetType().GetProperty(e.PropertyName);
         if (dateTimePropertyInfo != null)
         {
             DateTime dteValue = (DateTime)dateTimePropertyInfo.GetValue(sender, null);
             dateTimePropertyInfo.SetValue(sender, new DateTime(dteValue.Year, dteValue.Month, dteValue.Day, dteValue.Hour, dteValue.Minute, 0), null);
         }
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: peng-yuchu/Portfolio
        private void HandleCellePropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            Console.WriteLine(sender.GetType());
            Console.WriteLine(e.GetType());

            string temp = e.PropertyName;

            string[] values = temp.Split(',');

            Console.WriteLine("VALUES[2]:" + values[2]);

            this.dataGridView1.Rows[Convert.ToInt32(values[0])].Cells[Convert.ToInt32(values[1])].Value = values[2];
        }