摘要:
DateTime DTtime; private void dataGrid2_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (DTime.ToString()!="0001/1/1 0:00:00")//如果DTime是第一次运行,没有设置值,就会是0001/1/1 0:00:00 { TimeSpan ts = DateTime.Now -DTime ; if (int.P... 阅读全文
摘要:
private void dg_SelectionChanged(object sender, SelectionChangedEventArgs e) { //获取选定单元格列 Int32 i = dg.CurrentColumn.DisplayIndex; //取值 string sColumnValue = ((TextBlock)this.dg.Columns[i].GetCellContent(this.dg.SelectedItem)).Text.Trim(); } 阅读全文