private void dataGrid_UnloadingRow(object sender, Microsoft.Windows.Controls.DataGridRowEventArgs e) { if (((DataGrid)sender).SelectedItem != null || ((DataGrid)sender).CurrentItem == null) { return; } Product myProduct = (Product)((DataGrid)sender).CurrentItem; productManager.Delete(myProduct.Id); updateGrandTotals(); }
void dataGrid_LoadingRow(object sender, Microsoft.Windows.Controls.DataGridRowEventArgs e) { // Get the DataRow corresponding to the DataGridRow that is loading. EvalData item = e.Row.Item as EvalData; if (item != null) { if (item.value == 1) { e.Row.Foreground = new SolidColorBrush(Colors.HotPink); } } }
void dataGrid_LoadingRow(object sender, Microsoft.Windows.Controls.DataGridRowEventArgs e) { // Get the DataRow corresponding to the DataGridRow that is loading. ListData item = e.Row.Item as ListData; if (item != null) { if (item.state == "新帐号") { e.Row.Foreground = new SolidColorBrush(Colors.Blue); } } }
void gameGrid_LoadingRow(object sender, Microsoft.Windows.Controls.DataGridRowEventArgs e) { // Get the DataRow corresponding to the DataGridRow that is loading. GameData item = e.Row.Item as GameData; if (item != null) { if (item.price > 0) { e.Row.Foreground = new SolidColorBrush(Colors.Green); } } }
private void MainDataGrid_LoadingRow(object sender, Microsoft.Windows.Controls.DataGridRowEventArgs e) { Microsoft.Windows.Controls.DataGrid dataGrid = (Microsoft.Windows.Controls.DataGrid)sender; //string colProperty = "Help"; //Microsoft.Windows.Controls.DataGridTextColumn col = new Microsoft.Windows.Controls.DataGridTextColumn(); //col.Binding = new Binding(colProperty); //var spHeader = new StackPanel() { Orientation = Orientation.Horizontal }; //spHeader.Children.Add(new TextBlock(new System.Windows.Documents.Run(colProperty))); //var button = new Button(); //button.Click += Button_Filter_Click; //button.Content = "Help"; //spHeader.Children.Add(button); //col.Header = spHeader; //dataGrid.Columns.Add(col); }