Questions tagged as 'datagrid'

1
answer

Added multiple items in a DataGrid by List

I have two textboxes. One for e-mail and the other for remarks. When the user clicks the add button, it should be adding to my datagrid, but to no avail! How can I do this? As the user clicks on the add button, he has to increase the rows of the...
asked by 27.05.2015 / 19:20
0
answers

UWP Community Toolkit, DataGrid control: how to align cell content to the right

I have a numeric column in a DataGrid that I want your content to be aligned on the right. I read the documentation , especially Customizable templates and styling for cells, rows and headers where I ended up with this code to get the conten...
asked by 26.09.2018 / 20:01
0
answers

Background problem in the DataGrid Header

I have the following code block defining the Header style in my xaml: <Style TargetType="{x:Type DataGridColumnHeader}"> <Setter Property="Background" Value="DimGray"/> <Setter Property="H...
asked by 19.07.2018 / 22:00
1
answer

Problem in displaying the wpf datagrid control

I'm experiencing two issues with the wpf datagrid control. The first one: I have the main form, where some data is displayed, and another where the data is inserted. When I click to enter the data and the first form was hidden the control column...
asked by 08.12.2016 / 22:37
0
answers

Binding in TextBox with DataGrid (WPF)

I have a TextBox where I get the client id and also have a DataGrid where it has some personal information. Well that's fine, what I can not do is connect the two in the following way: When I change the value of the TextBox (client id) changin...
asked by 21.05.2015 / 19:21
1
answer

WPF select all CheckBox DataGrid

Hello, I'm trying to select all CheckBoxes from a datagrid but I'm not succeeding. Below is my code to select: private void CheckUnCheckAll(object sender, RoutedEventArgs e) { CheckBox chkSelectAll = ((CheckBox)sender); if (chkSelect...
asked by 23.02.2018 / 21:02
1
answer

Building DataGrid with C # WPF at runtime

I have a DataTable where I will store some data that the user informs and through it I want to pass the information to the DataGrid. gvDados.ItemsSource = dt.DefaultView; //Essa é a ligação entre o DataTable e a Grid In case the user inform...
asked by 09.02.2017 / 17:20
2
answers

Constructor method to calculate age

I am making a very simple client registration application I would like to know how to program a method that calculates and returns the age (in years) from the AnoNascimento attribute. I know how to do, for example, a "public static int Calculati...
asked by 03.03.2017 / 02:44
1
answer

Upload Image from DataGrid to Image

The variable x is associated with an image (blob field) that I uploaded to a Datagrid from a MySQL database. DataRowView selectedRecord = (DataRowView)dataGridImagem.SelectedItem; var x= selectedRecord.Row.ItemArray[2]; How can I now procee...
asked by 14.12.2016 / 22:02
1
answer

Error when cleaning a DataGrid

After I've saved my items that are in the DataGrid to a database, I'd like it cleaned up. So I used it like this: dg.Items.Clear(); But then this error appears:    Operation is not valid while ItemsSource is in use. Access and modify ele...
asked by 10.06.2015 / 20:03