datagrid

Combining matching values in 2 observablecollections into a 3rd [WPF]

橙三吉。 提交于 2021-01-29 17:02:19
问题 Hello so I have one ObservableCollection that looks like this: new time { Arrival = stringlist[0], Departure = stringList[1]}; new time2 { Arrived = stringlist[0], Departed = stringList[1]}; I would like to make a new ObservableCollection called datagridTime and insert into this ObservableCollection only records that match so lets say we have Time `ObservableCollection` Arrival | Departure --------------------------------- 10 20 10 30 10 10 Time2 `ObservableCollection` Arrival | Departure ---

How to use the same DataTemplate and bind to outside dynamic properties

非 Y 不嫁゛ 提交于 2021-01-29 08:02:05
问题 I successfully set up my datagrid to support filtering . All I did was create a DataTemplate that contained a toggle button and a popup window with a TextBox serving as the filter search box. I created two for each column (total of 2) this way in the <DataGrid.Resources></DataGrid.Resources> Here is my xaml: <DataTemplate x:Key="FooHeaderTemplate"> <Grid Margin="0, 0, -5, 0"> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions>

WPF Datagrid virtualization getting disabled when placed in a scrollviewer

╄→尐↘猪︶ㄣ 提交于 2021-01-29 06:11:42
问题 I have a scenario where in I am using two datagrids basically to achieve grouping as shown below. For achieving synchronized scrolling between two grids I am using a scrollviewer. Using scroll viewer is disabling the virtualization and loading data in datagrids is getting affected drastically. below is the sample code I am using. Any suggestions whould be of gr8 help. <Grid Name="Test" Background="White"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="*" /> <

Expand grid in R with unlist and apply

自闭症网瘾萝莉.ら 提交于 2021-01-29 05:16:09
问题 I am looking to use R's expand.grid to comprehensively enumerate and investigate options for hierarchical clustering analysis. I have a final function acc which will take a matrix and analyse it for performance measures like accuracy, precision, F1 etc., returning a named list (with accuracy, F1, etc.): the ultimate output I'm looking for is a table where all the hyperparameter combinations are listed and, in columns next to them, the different performance measures (accuracy, F1,...). The

How to change background color for some cell in WPF DataGrid?

雨燕双飞 提交于 2021-01-29 02:38:31
问题 I have a datagrid binded to an object collection. One property of the objects is a string that store a color value. On this "COLORBACKGROUND" cell click, a colorpicker opens to change it. What I need is to change the background color of the cell by the value displayed in datagrid rows (#RGB). <DataGrid SelectionUnit="Cell" SelectedCellsChanged="DgDataTable_OnSelectedCellsChanged" x:Name="DgDataTable" Grid.Row="0" Grid.ColumnSpan="2" Margin="10,20,10,0" AutoGenerateColumns="true"

How to change background color for some cell in WPF DataGrid?

蓝咒 提交于 2021-01-29 02:33:50
问题 I have a datagrid binded to an object collection. One property of the objects is a string that store a color value. On this "COLORBACKGROUND" cell click, a colorpicker opens to change it. What I need is to change the background color of the cell by the value displayed in datagrid rows (#RGB). <DataGrid SelectionUnit="Cell" SelectedCellsChanged="DgDataTable_OnSelectedCellsChanged" x:Name="DgDataTable" Grid.Row="0" Grid.ColumnSpan="2" Margin="10,20,10,0" AutoGenerateColumns="true"

Selection does hide the DataGridCell

冷暖自知 提交于 2021-01-28 12:30:52
问题 I have a data grid: <DataGrid x:Name="grid1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ItemsSource="{Binding}" IsReadOnly="True" Loaded="grid1_Loaded" AutoGeneratingColumn="grid1_AutoGeneratingColumn" SelectionUnit="Cell" MouseMove="Grid1_MouseMove" LoadingRow="grid1_LoadingRow" MouseLeave="grid1_MouseLeave"> <DataGrid.Resources> <Style TargetType="{x:Type DataGridCell}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type DataGridCell}">

WPF DataGridTemplateColumn cell style not displaying value

走远了吗. 提交于 2021-01-28 11:45:25
问题 I am trying to create a style for datagridcell. But the text value is not displayed.Data grid was populated by the Observable collection of type Student. Please find my xaml code below. StdCollection = new ObservableCollection<Student>() { new Student(){Name="Ram",StudID=01,Total=88}, new Student(){Name="John",StudID=02,Total=55}, new Student(){Name="Amar",StudID=03,Total=77}, new Student(){Name="Azar",StudID=04,Total=98}, }; <DataGrid Name="dgTest" CanUserAddRows="False" CanUserResizeColumns

WPF DataGridTemplateColumn cell style not displaying value

孤街醉人 提交于 2021-01-28 11:39:53
问题 I am trying to create a style for datagridcell. But the text value is not displayed.Data grid was populated by the Observable collection of type Student. Please find my xaml code below. StdCollection = new ObservableCollection<Student>() { new Student(){Name="Ram",StudID=01,Total=88}, new Student(){Name="John",StudID=02,Total=55}, new Student(){Name="Amar",StudID=03,Total=77}, new Student(){Name="Azar",StudID=04,Total=98}, }; <DataGrid Name="dgTest" CanUserAddRows="False" CanUserResizeColumns

How to add button in first row of datagrid column?

我的未来我决定 提交于 2021-01-28 08:08:24
问题 Hello I am developing one wpf application. I am using datagrid from wpf toolkit. I am binding grid by provider item source from database. it works fine. Now i want to add button in first row in some column, so is there any way to add button ? 回答1: <DataGrid Name="dgtest"> <DataGrid.Columns> <DataGridTemplateColumn> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <Button x:Name="button" Content="click me" Visibility="Collapsed" /> <DataTemplate.Triggers> <DataTrigger Binding="{Binding