void grid_LoadedCellPresenter(object sender, DataGridCellEventArgs e)
 {
     if (e.Cell.Column.Name == "ExpectedDelivery")
     {
         ProductDeliveryInfo p = (ProductDeliveryInfo)e.Cell.Row.DataItem;
         DateTime realDelivery = p.ReadyForDelivery.AddDays(p.DeliveryDays);
         int daysDifference = p.ExpectedDelivery.Subtract(realDelivery).Days;
         if (daysDifference < -2)
         {
             e.Cell.Presenter.Background = (Brush)Resources["ProblemBrush"];
         }
         else if (daysDifference < 0)
         {
             e.Cell.Presenter.Background = (Brush)Resources["DelayBrush"];
         }
         else if (daysDifference < 1)
         {
             e.Cell.Presenter.Background = (Brush)Resources["WarningBrush"];
         }
     }
 }
 private void DataGridCellCollection_CellRemoved(object sender, DataGridCellEventArgs e)
 {
     if (this._cellsElement != null)
     {
         this._cellsElement.Children.Remove(e.Cell);
     }
 }
 private void grid_LoadedCellPresenter(object sender, DataGridCellEventArgs e)
 {
     if (e.Cell.Column.Name == "Name")
     {
         var task = e.Cell.Row.DataItem as Task;
         e.Cell.Presenter.Padding = new Thickness(task.Level * 16, 0, 0, 0);
     }
     else
     {
         e.Cell.Presenter.Padding = new Thickness();
     }
 }
 void grid_UnloadedCellPresenter(object sender, DataGridCellEventArgs e)
 {
     // set as defualt, for recycling
     e.Cell.Presenter.Background = null;
 }
示例#5
0
        private void cgGrid_LoadedCellPresenter(object sender, DataGridCellEventArgs e)
        {
            var helper = new C1MouseHelper(e.Cell.Presenter);
            helper.MouseDoubleClick += (s, a) =>
            {
               // ShowDetail();

            };
        }
 private void variableGrid_CurrentCellChanged(object sender, DataGridCellEventArgs e)
 {
     //MessageBox.Show("Cell Changed");//the moment you click another cell
 }