Questions tagged [datagrid]

A graphical user interface element that presents a tabular view of data.

0
votes
0answers
15 views

How to get the `DataGridTextColumn` name and header of a `datagrid `through `code-behind`?

I am working with datagrid and I want to get the name and header of the datagridtextcolumn in code behind. I have tried getting header value as `Datagrid.Columns[0].HeaderText` . But HeaderText ...
0
votes
0answers
24 views

How to use ContextMenu to access cell value of DataGrid?

Here is what I did using WPF / C#: Use DataGrid to display data from a DataTable. This step works fine. Add a ContextMenu to the DataGrid. This also seems to be fine as the context menu show up ...
0
votes
0answers
24 views

How to get info from object in the datagrid while this object is Entity Framework object?

I want to get the value of the selected cell as string. But I can't select it as an Entity Framework object. I tried to do it with a list of objects not from Entity Framework and it works fine: ...
1
vote
1answer
26 views

WPF disable default keybinding on DataGrid (as if it was never defined)

I would like to disable some of the default behaviours of DataGrid keys in order to override it with my own improved commands. How can I disable DataGrid's keybinds as if they were never defined in ...
0
votes
0answers
11 views

How to implement a selection changed and a clicked in same data grid?

I have a datagrid with a column for radio button and may other columns. My datagrid has a selectionchanged and the radio button has got a clicked. Here radio button is used to select the item wanted ...
0
votes
1answer
24 views

Assign DataGridRow.Header Value from DataRow Nth column

I have a DataTable Dt as a ItemsSource for my DataGrid and I was wondering if there is any way to bind a cell value from Nth column to each DataGridRow.Header? <DataGrid ItemsSource="{Binding Dt}"&...
0
votes
0answers
20 views

How to save changes to database when i close the “edit window”

I have to create a wpf application, where row in app is send to another window. I've got that created. I should be able to edit data in that window and after clicking a button, window should be closed ...
0
votes
1answer
24 views

How can i set the Columnname of my Datagrid dynamically?

I read some data from a datagrid, named dgTable2(3 Columns, unknown Rows). After that, i want to make for every row inside dgTable2, a new column inside dgTable3 and as headername i want to set the ...
0
votes
0answers
27 views

How to implement a report inside a report using datagrid for Rails

I'm trying to create a report "inside" another report, to show the number of samples sent, grouped by agent and everything grouped by type of sample. I'm not sure how to do it, if I should create a ...
1
vote
1answer
17 views

How to retrieve DataRow from DataRow.ContextMenu event

How can a bind DataRow to the Tag property of the ContextMenu.MenuItem associated with that row? Here is what I have so far: <DataGrid.Resources> <ContextMenu x:Key="RowContextMenu"> ...
-1
votes
1answer
24 views

WPF: Datagrid doesn't show Data [duplicate]

I wanna show a List in my DataGrid Unfortunately it doesn't show anything. I know that their are many other threads with this topic but I couldn't apply them to my solution. I tried several things: ...
-1
votes
0answers
10 views

How to Export DataGrid ItemsSource to Database with multiple Tables using Dapper

I am trying to insert the ItemsSource of my DataGrid to my SQL-Server Database using Dapper. My Database has three Tables (Applicant, Address, Graduation). How can I insert e.g. the first three ...
0
votes
0answers
22 views

Vertical Orientation of DataGrid Column Header [duplicate]

Is it possible to orient column headers vertically in datagrid in wpf? (as shown in the picture below) <DataGrid x:Name="DoorMatrixTable" ItemsSource="{Binding Dt}" CanUserAddRows="False" ...
0
votes
1answer
32 views

Something error happens when I try to add an items to Data grid or clear the Data grid

I have a data grid and it is empty at first. Then I need to add items when the user selects some data. But here it shows error like Error : System.InvalidOperationException: Operation is not valid ...
-2
votes
0answers
57 views

C# WPF datagrid System.IndexOutOfRangeException

I am trying to delete items from datagrid by using checkbox but I can't move forward due to System Index out of Range. plz help private void Delete_button_Click(object sender, RoutedEventArgs e) { ...
0
votes
0answers
13 views

UWP DataGrid : Handling Enums to have an alternate text displayed in the cell

I have a simple enum and when binding to the UWP DataGrid (Windows Community Toolkit) it will display the value of the enumerator list i.e. R B or G from the enum def below. Are there any options to ...
0
votes
0answers
23 views

DataGrid virtualization on collectionview refresh

Specifically this is a follow-up to this question DataGrid filter performance, but there are many more similar questions relating to WPF DataGrid performance on StackOverflow. After a lot of ...
0
votes
0answers
45 views

UWP Toolkit DataGrid - How to Properly bind ItemSource to Model?

I'm using the UWP Toolkit's DataGrid to display records from a model which pulls from a SQLite database. I'm having challenges binding the DataGrid to the model and have created the following thus ...
0
votes
1answer
27 views

How to move selected row into visible area in DataGrid ? (MVVM)

This is my situation. I have a DataGrid with many items. <DataGrid Grid.Row="2" ItemsSource="{Binding Dati, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" ...
0
votes
0answers
33 views

DataGrid.Refresh generates “Object reference not set to an instance of an object” message in c# WPF

In my WPF project I display data from a List of a class in a DataGrid. Every time the information from that list changes the DataGrid gets refreshed. This works correctly when a new item is added to ...
0
votes
0answers
23 views

How to Insert Records into UWP Community Toolkit DataGrid?

I'm using the UWP Community Toolkit's DataGrid to present information from my ActivityLogEntryModel as follows: <controls:DataGrid x:Name="ActivityLogDataGrid" AutoGenerateColumns="False" ...
-1
votes
0answers
26 views

How to add DataGridView? Found only DataGrid

EDIT: DataGrid is WPF, DataGridView is WindowsForms. (Thanks to Mathivanan KP) I'm using Visual Studio 2017, .NET Framework 4.5.2 and I'd like to use the new DataGridView, which is the replacement ...
0
votes
0answers
39 views

Copy a selected “custom” row in a Datagrid to another (WPF)

my problem is about a DataGrid, I want to copy a row to another DataGird in another form. the DataGird looks like this : on the click I want to show the selectedItem in the other DataGird but instead ...
0
votes
0answers
20 views

Using Datagrid HeaderTemplate button to change Datagrid Row buttons

I have a datagrid bound to a collection of timesheet lines. In each row I have included a custom usercontrol consisting of 3 Radio buttons in the last column. These indicate whether each line should ...
0
votes
0answers
18 views

How to increase the accuracy of regulargridinterpolator

I have created a h5 file of an analytical function on a regular gird. To get the derivatives of that function I have used numpy.gradient here. But the problem is I have got very poor result for the ...
0
votes
1answer
50 views

How to update DataGrid

The DataContext of the app is bound to my MainViewModel. This ViewModel has a property services and some other properties. When I start a service I want to call OnPropertyChanged("Services") inside my ...
0
votes
0answers
26 views

Detect modifications occured In DB and update my Grid

I have created a program that shows the content of my table into a <DataGrid>. So far, I used an ObservableCollection which contains the result of my Select database query. What I want to ...
0
votes
1answer
23 views

How can I bind a XML web response into a dataGridView in a Windows Forms using C#?

I am working in a Plugin in Windows Forms in C#. I basically send a soap request and get a response in xml. I am simply returning the response in a message box right now but I am trying to bind the ...
1
vote
0answers
42 views

Column Header - how to set bottom border thickness > 1

I can set the DataGridColumnHeader BorderThickness (Bottom) > 1 but all that displays is a 1px line. Not what I want. Is this a bug? Am I doing something wrong? Here's the relevant code: <...
0
votes
2answers
31 views

C# how to bind a datagrid t observableCollection of classes with observable collections using code behind

I have a datagrid which has to be associated to an observable collection of the following class: public class CfgCounters { public int valuePresent { get; set; } public string Name { get; set;...
0
votes
0answers
48 views

C# WPF DataGrid virtualization is slow

I have a DataGrid with 10-15 columns which can have around 100-200 rows. The datagrid is placed within a Tab control ( which is not in focus by default ). I tried to virtualize the DataGrid but when ...
-1
votes
0answers
44 views

How to bind a Dictionary<Enum, List<String>> to a DataGrid with a ComboBox in It

I'm trying to find out how to do this.. Background: Basically i'm porting the content of a Google Spreadsheet to a WPF Application via a DataGrid. The Spreadsheet has a dropdown per column, looking ...
-2
votes
1answer
22 views

Can't two way bind object which is inside of an object

I'm trying to two way bind in a datagrid one class. The strucure of class is like this: class Company : BaseProps { public string CompanyName { get; set; } public Employee Employee { get; ...
0
votes
0answers
25 views

Datagrid displaying as an empty datagrid. Even headers not showing

I was trying to create a suggestion list. Which means when I type barcode, all barcodes starting with what I typed should be displayed in another data grid. The data grid display is correct row ...
0
votes
0answers
19 views

DataGridView Paint Stacked Headers

Im paiting headers over the cell but I'm getting weird behaviour, in the top left corner of the first cell are stacked or painted text which are not visible at that time. I have posted whole code ...
-1
votes
0answers
28 views

Suggest best datagrid for angular?

I'm going to create Dynamic backend tools, please suggest which is the best data grid for angular based application
0
votes
1answer
39 views

Remove header border of a DataGrid

How can I remove the grey line which is visible between the Header and the Row of a DataGrid.
0
votes
0answers
28 views

DataGrid Columns contents

I am using DataGrid in my project. And here in my code I don't understand why the text of the textblock is not visible in columns. <DataGrid Grid.Column="0" Name="Res1" Background="White"> &...
0
votes
0answers
12 views

save grouping state of devexpress datagrid to localstorage

Devexpress datagrid can save its state to localstorage with the help of: stateStoring={{ enabled: true, type: "custom", customSave: this.saveToStorage, customLoad: this.loadFromStorage, ...
1
vote
0answers
35 views

ComboBox in DataGrid is being emptied only when ItemsSource depends on row

I find myself in a situation where whether or not a given ComboBox in a DataGridRow is being emptied depends on whether or not its ItemsSource is bound to the row in the DataGrid or in the parent. ...
0
votes
0answers
29 views

Bind control event to code event/command/method

I have a datagrid that I would like to, whenever values in any cell change in gui, updates other properties in the view model. I have seen this but I wonder if could be done by binding an event such ...
0
votes
0answers
9 views

Clarity datagrid First column after collapse, filter gets hides in navigation panel after click on Clarity datagrid filter

Clarity datagrid First column after collapse, filter gets hides in navigation panel after click on Clarity datagrid filter enter image description here
-2
votes
0answers
32 views

What is the most correct way to fully adapt this code to the MVVM pattern?

I have a DataGrid with a DataGridComboBoxColumn. Each ComboBox should have the same drop-down: the new values entered in the ComboBox (the ComboBox is editable and accepts the Enter key for ...
1
vote
2answers
49 views

How to change background color of a cell in WPF datagrid based on its value

I would like to Change the Background of a cells in a wpf datagrid according to ist value. My datagrid is as follows: <DataGrid x:Name="dataGridView_Comparison" ItemsSource="{Binding}" ...
0
votes
0answers
14 views

WPF DataGrid does not use virtualization when filtering/sorting

I am struggling with poor performance when filtering/sorting a WPF DataGrid, and I have discovered, through profiling, that apparently no virtualization is done during these operations. What I mean ...
0
votes
0answers
9 views

How can I add a comboboxitem associated with a custom click event handler to all comboboxes in a DatagridTemplateColumn,in WPF

The data source of my comboboxes in 'DatagridTempalteColumn' are binded to a observable collection.How can I add a default item associated to a event handler,so that the program will do something ...
0
votes
1answer
16 views

How to make the ComboBox column's editor elements save the user-selected new value?

The full XAML and code-behind are below. I have a Window with a DataGrid with a single column, a DataGridComboBoxColumn. In its EditingElementStyle I set the ComboBox-es editable and set their ...
0
votes
1answer
18 views

How to hide the ComboBox's drop-down on click on one of its ComboBoxItem-s when the ComboBox is inside a DataGridComboBoxColumn?

I have the complete XAML markup below (no code-behind is needed): a Window with a Grid with a DataGrid with a single column of type DataGridComboBoxColumn with its Header and EditingElementStyle ...
1
vote
2answers
47 views

How to sort custom classes in datatable cell in datagrid with autogenerate columns

I have DataGrid with DataTable ItemSource. In DataTable cells there are myClass objects with displayField property for display data and sorting. Here I try to set correct SortMemberPath value: ...
0
votes
0answers
20 views

How can I have report values filtered from webdatarocks?

I'm using WebDataRocks report from https://www.webdatarocks.com but when I try to use the method report.getData({}) the following error happens: error I need the current values filtered to export ...

http://mssss.yulina-kosm.ru