private void gridAccounts_LoadingRow(object sender, DataGridRowEventArgs e) { e.Row.Header = e.Row.GetIndex() + 1; //DataGridCell cell = e.Row.GetCell(0); //cell.Content = e.Row.GetIndex() + 1; }
private void NastilyUpdateRowToAvoidStupidRowRecyclingProblems(object sender, DataGridRowEventArgs e) { foreach (CustomBoundColumn column in _viewModel.QueryResult.Columns) { column.Update(e.Row); } }
private void DtGridUsers_LoadingRow(object sender, DataGridRowEventArgs e) { //SetRowLogo(DtGridUsers, e.Row, "T_SYS_USER"); int index = e.Row.GetIndex(); var cell = DtGridUsers.Columns[0].GetCellContent(e.Row) as TextBlock; cell.Text = (index + 1).ToString(); }
private void Grid2_LoadingRow(object sender, DataGridRowEventArgs e) { Table16x12 rpm_axis_idle = new Table16x12(); var id = e.Row.GetIndex(); e.Row.Header = rpm_axis_idle.rpm_idle_axis[id]; }
private void dg_LoadingRow(object sender, DataGridRowEventArgs e)//点击回车新加载一行 { T_OA_SATISFACTIONDETAIL temp = (T_OA_SATISFACTIONDETAIL)e.Row.DataContext; ImageButton MyButton_Delbaodao = dg.Columns[3].GetCellContent(e.Row).FindName("myDelete") as ImageButton; MyButton_Delbaodao.Margin = new Thickness(0); MyButton_Delbaodao.AddButtonAction("/SMT.SaaS.FrameworkUI;Component/Images/ToolBar/ico_16_delete.png", Utility.GetResourceStr("DELETE")); MyButton_Delbaodao.Tag = temp; }
private void ProductFiles_LoadingRow(object sender, DataGridRowEventArgs e) { ProjectFilesEntity lprojectFilesEntity = e.Row.DataContext as ProjectFilesEntity; if (lprojectFilesEntity.FileDelete) { e.Row.Background = new SolidColorBrush(Colors.Black); } }
//datagrid行加载事件 private void dgMatchInfo_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { // TODO: Add event handler implementation here. Grid Grid = dgMatchInfo.Columns[4].GetCellContent(e.Row) as Grid; CheckBox cb1 = Grid.Children[0] as CheckBox; cb1.Click += new RoutedEventHandler(cb1_Click); }
void DataGrid_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { UserInterface.ViewModel.CommandWMSViewModel r = e.Row.Item as UserInterface.ViewModel.CommandWMSViewModel; if (r.Status == Services.EnumCommandWMSStatus.Active) { dgCmd.ScrollIntoView(e.Row.Item); } }
private void InvoicesDG_LoadingRow(object sender, DataGridRowEventArgs e) { DataGridRow dataGridrow = DataGridRow.GetRowContainingElement(e.Row); // Hyperlink edit = colIssue").GetCellContent(dataGridrow) as Hyperlink; // edit.Content = _messageResolver.GetText("sl.creditnote.invoicelist.grid.col.issue.text"); // HyperlinkButton deactivate = colViewInvoice").GetCellContent(dataGridrow) as HyperlinkButton; // deactivate.Content = _messageResolver.GetText("sl.creditnote.invoicelist.grid.col.view.text"); }
private void gridProducts_LoadingRow(object sender, DataGridRowEventArgs e) { Product product = (Product)e.Row.DataContext; if (product.UnitCost > 100) e.Row.Background = highlightBrush; else e.Row.Background = normalBrush; }
private void dgTracker_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { Unit newUnit = e.Row.Item as Unit; if (newUnit != null) { newUnit.hp = 1; } }
private void DataGrid1_LoadingRow(object sender, DataGridRowEventArgs e) { T_Model bindData = (T_Model)e.Row.DataContext; Button btn = DataGrid1.Columns[2].GetCellContent(e.Row).FindName("Button1") as Button; btn.Tag = bindData.id; btn = DataGrid1.Columns[3].GetCellContent(e.Row).FindName("btn_Del") as Button; btn.Tag = bindData.id; }
private void myDataGrid_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { Column myObject = e.Row.Item as Column; if (myObject != null) { ViewModel vm = this.DataContext as ViewModel; myObject = vm.MySettings.DefaultColumn.Clone(); } }
private void ApplicationsGridLoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs args) { var column = ApplicationsGrid.Columns[0]; var cell = column.GetCellContent(args.Row).Parent as DataGridCell; if (cell != null) { cell.DataContext = ((object[])args.Row.DataContext)[1]; } }
private void dgPlayType_P_LoadingRow(object sender, DataGridRowEventArgs e) { (dgPlayType_P.Columns[0].GetCellContent(e.Row) as TextBlock).Text = (e.Row.GetIndex() + 1).ToString(); (dgPlayType_P.Columns[6].GetCellContent(e.Row) as Button).Tag = e.Row.DataContext; PlayTypeRadioInfo playType =e.Row.DataContext as PlayTypeRadioInfo; if (playType.Multiple == 1000) (dgPlayType_P.Columns[5].GetCellContent(e.Row) as TextBlock).Text = "固定返点"; else (dgPlayType_P.Columns[5].GetCellContent(e.Row) as TextBlock).Text = (e.Row.DataContext as PlayTypeRadioInfo).MinScale.ToString(); }
/// <summary> /// System.Windows.Controls.DataGrid.LoadingRow イベントを発生させる。 /// </summary> /// <param name="e">イベントのデータ。</param> protected override void OnLoadingRow(DataGridRowEventArgs e) { base.OnLoadingRow(e); DataGridRow row = e.Row; // DataGridRowにダブルクリック検知用イベントハンドラを追加する。 row.MouseLeftButtonUp -= new MouseButtonEventHandler(this.Row_MouseLeftButtonUp); row.MouseLeftButtonUp += new MouseButtonEventHandler(this.Row_MouseLeftButtonUp); }
// загрузка строк // происходит форматирование строк в зависимости от цены автомобиля! private void dgMain_LoadingRow(object sender, DataGridRowEventArgs e) { if (!(e.Row.DataContext is Car)) return; Car car = (Car)e.Row.DataContext; if (car.Price > 15000) e.Row.Foreground = new SolidColorBrush(Colors.Red); else e.Row.Foreground = new SolidColorBrush(Colors.Blue); }
private void DataGridAPARLoadingRow(object sender, DataGridRowEventArgs e) { var item = e.Row.DataContext as DeliveryLine; if (item != null) { if (item.Id == 0) { e.Row.Foreground = Brushes.Red; } } }
private void dataGrid_LoadingRow(object sender, DataGridRowEventArgs e) { // Get the DataRow corresponding to the DataGridRow that is loading. DataGridRow row = e.Row; var log = (SystemJobLogEntry) row.Item; if (log.Message != null) { e.Row.Background = new SolidColorBrush(Colors.LightPink); e.Row.ToolTip = log.Message; } }
private void dgMain_LoadingRow(object sender, DataGridRowEventArgs e) { dgMain.Columns[0].Width = new DataGridLength(0.2, DataGridLengthUnitType.Star); dgMain.Columns[1].Width = new DataGridLength(0.3, DataGridLengthUnitType.Star); dgMain.Columns[2].Width = new DataGridLength(0.3, DataGridLengthUnitType.Star); dgMain.Columns[3].Width = new DataGridLength(0.3, DataGridLengthUnitType.Star); dgMain.Columns[4].Width = new DataGridLength(0.3, DataGridLengthUnitType.Star); dgMain.Columns[5].Width = new DataGridLength(0.6, DataGridLengthUnitType.Star); dgMain.Columns[6].Width = new DataGridLength(1, DataGridLengthUnitType.Star); dgMain.Columns[7].Width = new DataGridLength(1, DataGridLengthUnitType.Star); dgMain.Columns[8].Width = new DataGridLength(0.3, DataGridLengthUnitType.Star); }
void cacheList_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { // Get the DataRow corresponding to the DataGridRow that is loading. GAPPSF.Core.Data.Geocache item = e.Row.Item as GAPPSF.Core.Data.Geocache; if (item != null) { e.Row.Header = (e.Row.GetIndex() + 1).ToString(); } else { e.Row.Visibility = System.Windows.Visibility.Collapsed; } }
void cacheList_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { // Get the DataRow corresponding to the DataGridRow that is loading. Framework.Data.Geocache item = e.Row.Item as Framework.Data.Geocache; if (item != null) { e.Row.Header = (e.Row.GetIndex() + 1).ToString(); //DataRow row = e.Row; // Access cell values values if needed... // var colValue = row["ColumnName1]"; // var colValue2 = row["ColumName2]"; // Set the background color of the DataGrid row based on whatever data you like from // the row. //if (item.Owner == SimpleCacheListForm.FixedCore.GeocachingComAccount.AccountName) if (item.IsOwn) { e.Row.Background = _ownBrush; } else if (item.Found) { e.Row.Background = _foundBrush; } else if (item.Archived) { e.Row.Background = _archivedBrush; } //else if (item.ContainsCustomLatLon) //{ // e.Row.Background = _extrCoordBrush; //} else if (!item.Available) { e.Row.Background = _notAvailableBrush; } else if (item.ContainsCustomLatLon) { e.Row.Background = _extrCoordBrush; } else { e.Row.Background = _availableBrush; } } else { e.Row.Visibility = System.Windows.Visibility.Hidden; } }
private void DataGrid_LoadingRow(object sender, DataGridRowEventArgs e) { var answer = e.Row.DataContext as MRZS.Web.Models.Answer; var answersStatisticViewModel = (sender as DataGrid).DataContext as AnswersStatisticViewModel; if (answersStatisticViewModel.ResultAnswers.Any(ra => ra.AnswerId == answer.AnswerId && answer.IsCorrect)) { e.Row.Foreground = new SolidColorBrush(Colors.Green); } else if (answersStatisticViewModel.ResultAnswers.Any(ra => ra.AnswerId == answer.AnswerId && !answer.IsCorrect)) { e.Row.Foreground = new SolidColorBrush(Colors.Red); } }
}//end OnRowNumbersChanged /// <summary> /// Event handler that handles refreshing the row numbers in the row headers. /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private static void RefreshRowNumbers(object sender, DataGridRowEventArgs args) { var grid = sender as ExtendedDataGrid; if (grid == null) return; if (grid.IsGroupByOn) return; foreach (var item in grid.Items) { var row = (DataGridRow)grid.ItemContainerGenerator.ContainerFromItem(item); if (row != null && row.GetIndex()!=-1) row.Header = (row.GetIndex() + 1).ToString(); } }//end RefreshRowNumbers
private void DaGr_LoadingRow(object sender, DataGridRowEventArgs e) { if (houseInfoList.Count() > 0) { houseObj = (T_OA_HOUSEINFO)e.Row.DataContext; var entity = from q in houseInfoList where q.HOUSEID == houseObj.HOUSEID select q; if (entity.Count() > 0) { CheckBox chkbox = DaGr.Columns[0].GetCellContent(e.Row).FindName("myChkBox") as CheckBox; chkbox.IsChecked = true; } } }
private void dataGrid1_LoadingRow(object sender, DataGridRowEventArgs e) { DataGridRow row = e.Row; Tarea t = row.Item as Tarea; // Similar a (Tarea)row.Item if (!t.Realizado && t.FechaVencimiento < DateTime.Now) { row.Background = new SolidColorBrush(Colors.Red); } else if (t.Realizado) { row.Background = new SolidColorBrush(Colors.LightGreen); } }
void dgDispatch_LoadingRow(object sender, DataGridRowEventArgs e) { BookingDispatching ds = (e.Row.DataContext) as BookingDispatching; string status = ds.Status.ToString(); if (ds.Status == DispatchingStatus.Waiting) e.Row.Background = new SolidColorBrush(Colors.Yellow); else if (status.ToString() == DispatchStatusOption.Dispatch.ToString()) { e.Row.Background = new SolidColorBrush(Colors.Magenta); } else if (status.ToString() == DispatchStatusOption.ChangePending.ToString()) { e.Row.Background = new SolidColorBrush(Colors.Yellow); } else if (status.ToString() == DispatchStatusOption.Completed.ToString()) { e.Row.Background = new SolidColorBrush(Colors.Blue); } else if (status.ToString() == DispatchStatusOption.Assigned.ToString()) { e.Row.Background = new SolidColorBrush(Colors.Purple); } else if (status.ToString() == DispatchStatusOption.DropOff.ToString()) { e.Row.Background = new SolidColorBrush(Colors.Orange); } else if (status.ToString() == DispatchStatusOption.InTransit.ToString()) { e.Row.Background = new SolidColorBrush(Colors.Green); } else if (status.ToString() == DispatchStatusOption.LateCancel.ToString()) { e.Row.Background = new SolidColorBrush(Colors.Red); } else if (status.ToString() == DispatchStatusOption.Pending.ToString()) { e.Row.Background = new SolidColorBrush(Colors.Cyan); } else if (status.ToString() == DispatchStatusOption.PreAssigned.ToString()) { e.Row.Background = new SolidColorBrush(Colors.Brown); } }
private void dgUsers_LoadingRow(object sender, DataGridRowEventArgs e) { DataGridRow dataGridrow = DataGridRow.GetRowContainingElement(e.Row); //StackPanel stackPanel = dgUsers.Columns.GetByName("colManageUser").GetCellContent(dataGridrow) as StackPanel; //Hyperlink edit = stackPanel.Children[0] as Hyperlink; //edit.Content = _messageResolver.GetText("sl.users.grid.col.edit"); //HyperlinkButton resetpwd = stackPanel.Children[2] as HyperlinkButton; //resetpwd.Content = _messageResolver.GetText("sl.users.grid.col.resetpwd"); ////HyperlinkButton deactivate = stackPanel.Children[4] as HyperlinkButton; ////deactivate.Content = _messageResolver.GetText("sl.users.grid.col.deactivate"); //HyperlinkButton delete = stackPanel.Children[6] as HyperlinkButton; //delete.Content = _messageResolver.GetText("sl.users.grid.col.delete"); }
private void dg_Calibration_LoadingRow(object sender, DataGridRowEventArgs e) { //wsCalibration item = e.Row.DataContext as wsCalibration; //dg_Calibration.AlternatingRowBackground = null; //if (item.resultName.Contains("не")) //{ // e.Row.Background = new SolidColorBrush(Colors.Red); // e.Row.Foreground = new SolidColorBrush(Colors.White); //} //else //{ // e.Row.Background = new SolidColorBrush(Colors.Green); // e.Row.Foreground = new SolidColorBrush(Colors.White); //} }
private void dgRoutes_LoadingRow(object sender, DataGridRowEventArgs e) { DataGridRow dataGridrow = DataGridRow.GetRowContainingElement(e.Row); //HyperlinkButton edit = dgRoutes.Columns.GetByName("colEdit").GetCellContent(dataGridrow) as HyperlinkButton; //edit.Content = _messageResolver.GetText("sl.routes.list.grid.col.edit"); //HyperlinkButton deactivate = dgRoutes.Columns.GetByName("colDeactivate").GetCellContent(dataGridrow) as HyperlinkButton; //deactivate.Content = _messageResolver.GetText("sl.routes.list.grid.col.deactivate"); ////StackPanel stackPanel = dgRoutes.Columns.GetByName("colManageRoute").GetCellContent(dataGridrow) as StackPanel; //HyperlinkButton edit = stackPanel.Children[0] as HyperlinkButton; //edit.Content = _messageResolver.GetText("sl.routes.list.grid.col.edit"); //HyperlinkButton delete = stackPanel.Children[4] as HyperlinkButton; //delete.Content = _messageResolver.GetText("sl.routes.list.grid.col.delete"); }
void dgDispatch_LoadingRow(object sender, DataGridRowEventArgs e) { Dispatch ds = (e.Row.DataContext) as Dispatch; string status = (string)ds.Status; if (status.ToString() == DispatchStatusOption.Closed.ToString()) { e.Row.Background = new SolidColorBrush(Colors.White); } else { e.Row.Background = new SolidColorBrush(Colors.Green); } }
/// <summary> /// Sets the text to the hiperlink depending if the user is able to view o modify the information /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void GridResults_LoadingRow(object sender, DataGridRowEventArgs e) { //Get the HyperLink Button to set the text accordingly HyperlinkButton editButton = GridResults.Columns.GetByName("colEdit").GetCellContent(e.Row) as HyperlinkButton; if (editButton == null) return; //Set the button text according to the Rol of the logged user if (App.CurrentUser.IsInRole(UserRoleEnum.Supervisor)) { editButton.Content = Strings.View; } else { editButton.Content = Strings.Edit; } }
private void namesList_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { var row = e.Row; var unit = row.DataContext as Unit; if (unit.HP <= 0) { row.Foreground = new SolidColorBrush(Colors.Black); } else if (unit.HP < unit.maxHP) { row.Foreground = new SolidColorBrush(Colors.Red); } else if (unit.skPoints1 > 0 || unit.atPoints > 0) { row.Foreground = new SolidColorBrush(Colors.Gold); } }
private void gridProducts_LoadingRow(object sender, DataGridRowEventArgs e) { if (e.Row.GetIndex() < gridProducts.Items.Count - 1) { // Check the data object for this row. Product product = (Product)e.Row.DataContext; // Apply the conditional formatting. if (product.UnitCost > 100000) { e.Row.Background = highlightBrush; } else { // Restore the default white background. This ensures that used, // formatted DataGrid objects are reset to their original appearance. e.Row.Background = normalBrush; } } }
private void ResultsDataView_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { DataGrid theGrid = sender as DataGrid; DataGridRow gridRow = e.Row; ResultEntry result = gridRow.DataContext as ResultEntry; if (result == null) { return; } if (result.Status != HttpStatusCode.OK) { gridRow.Foreground = new SolidColorBrush(Colors.Red); } else { gridRow.Foreground = new SolidColorBrush(Colors.Black); } }
private void DataGridAPARLoadingRow(object sender, DataGridRowEventArgs e) { //var item = e.Row.DataContext as ARAPClass; var item = e.Row.DataContext as ARAPClassForPrint; if (item != null) { if (item.Title == "-1") { e.Row.Background = Brushes.SteelBlue; e.Row.FontSize = 15; e.Row.Foreground = Brushes.Orange; } else { e.Row.Background = Brushes.White; e.Row.Foreground = Brushes.Black; e.Row.FontSize = 13; } } }
internal static void ColorGrid(System.Windows.Controls.DataGridRowEventArgs e) { Result obj = (Result)e.Row.Item; var converter = new System.Windows.Media.BrushConverter(); if (obj.Delay <= MainWindow.BestPing) { e.Row.Background = Brushes.Aqua; } else if (obj.Delay <= 75) { e.Row.Background = Brushes.GreenYellow; } else if (obj.Delay > 75 && obj.Delay <= 150) { e.Row.Background = (Brush)converter.ConvertFromString("#FFFFFF90"); } else { e.Row.Background = (Brush)converter.ConvertFromString("#ff3300"); } }
void MapBehaviorsDataGrid_LoadingRow(object sender, DataGridRowEventArgs e) { if (MapBehaviorsDataGrid != null && MapBehaviorsDataGrid.Columns != null) { DataGridRow row = e.Row; if (row != null) { Behavior<Map> behavior = (row.DataContext as ExtensionBehavior).MapBehavior; if (behavior != null) { foreach (DataGridColumn column in MapBehaviorsDataGrid.Columns) { TextBlock element = column.GetCellContent(row) as TextBlock; if (element != null) { element.SetValue(ToolTipService.ToolTipProperty, LocalizableStrings.GetString("TypeLabel") + " " + behavior.GetType().ToString()); } } } } } }
void dgOpenJourney_LoadingRow(object sender, DataGridRowEventArgs e) { BookingDispatching ds = e.Row.DataContext as BookingDispatching; //if( ds.Booking.Status == BookingStatus.Confirmed) // e.Row.Background = new SolidColorBrush(Colors.Yellow); //string status = (string)ds.Status; //if (status.ToString() == "IN TRANSIT") //{ // e.Row.Background = new SolidColorBrush(Colors.Green); //} //else if (status.ToString() == "ON LOCATION") //{ // e.Row.Background = new SolidColorBrush(Colors.Orange); //} //else if (status.ToString() == "CONFIRMED") //{ // e.Row.Background = new SolidColorBrush(Colors.Yellow); //} //dgOpenJourney.SelectedIndex = -1; }
private void quotes_LoadingRow(object sender, DataGridRowEventArgs e) { var quote = (Quote)e.Row.Item; switch (quote.Direction) { case "+": ChangeRowColor(e, Color.FromRgb(0, 255, 0), Color.FromRgb(255, 255, 255)); break; case "-": ChangeRowColor(e, Color.FromRgb(255, 0, 0), Color.FromRgb(255, 255, 255)); break; case "=": ChangeRowColor(e, Color.FromRgb(255, 255, 255), Color.FromRgb(0, 0, 0)); break; } }
private void DataGrid2_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { System.Windows.Controls.DataGridRow row = e.Row; TableColumnsMetadataItem item = (TableColumnsMetadataItem)row.Item; DataGrid2.SelectedItem = item; //DataGridCell cell = GetCell(DataGrid2.SelectedIndex, NamespaceColumn.DisplayIndex); //if (item.ColumnsSemantic == string.Empty) //{ // if (cell != null) // { // cell.IsEnabled = false; // } //} //else //{ // if (cell != null) // { // cell.IsEnabled = true; // } //} }
void dgTerapi_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { dgTerapi.ScrollIntoView(e.Row.Item); }
private void dg_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { e.Row.Header = ("O" + (e.Row.GetIndex() + 1)).ToString(); }
private void dataGridResults_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { // 在此处添加事件处理程序实现。 e.Row.Header = e.Row.GetIndex() + 1; }
private void dGrid_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { e.Row.Header = e.Row.GetIndex() + 1; }
private void DataGrid_LoadingRow(object sender, System.Windows.Controls.DataGridRowEventArgs e) { if (Locator.Settings.CurrentOption.Equals("0")) { if (e.Row.GetIndex() >= 12) { e.Row.Header = ""; return; } int row = e.Row.GetIndex(); if (row == 0) { e.Row.Header = "F1"; } if (row == 1) { e.Row.Header = "F2"; } if (row == 2) { e.Row.Header = "F3"; } if (row == 3) { e.Row.Header = "F4"; } if (row == 4) { e.Row.Header = "F5"; } if (row == 5) { e.Row.Header = "F6"; } if (row == 6) { e.Row.Header = "F7"; } if (row == 7) { e.Row.Header = "F8"; } if (row == 8) { e.Row.Header = "F9"; } if (row == 9) { e.Row.Header = "F10"; } if (row == 10) { e.Row.Header = "F11"; } if (row == 11) { e.Row.Header = "F12"; } } else { if (e.Row.GetIndex() > 9) { e.Row.Header = ""; return; } e.Row.Header = e.Row.GetIndex(); } }