Questions tagged as 'datagridview'

2
answers

How to make a datagridview C # sort a list (IList) with click on the grid header? [closed]

How to make a DataGridView C # sort a list (IList) with click on the grid header? For example, I have a list with three fields (id, name, city), when the user clicks on the name column, I want to sort by Name, if I click on the city I want...
asked by 02.01.2017 / 20:49
1
answer

Calculation in a DataGrid. W#

Hello. Is there any simple way, working directly with db of doing calculations in the cell of a DataGrid. Situation: I have a Column Qtd , another ValorUnitario and another ValorTotal of a certain item. I would lik...
asked by 15.08.2016 / 15:18
1
answer

How to concatenate data from a DataGridView and Save in a single field of the database

I want to concatenate and save the fields of a datagridview, however I do not know how to do this. What I Have: method: public void Gravar() { string strQuery; strQuery = "INSERT INTO Prato"; strQuery += (" VALUES("); str...
asked by 16.10.2016 / 05:53
4
answers

How to copy a datagrid to an arraylist

I have a button and command and when I click on it, I need to copy all information from my datagrid to an Arraylist. For example: The datagrid has 4 columns and 10 lines all have information, now comes my dilemma, when clicking on the baton I ne...
asked by 19.03.2015 / 15:59
1
answer

Data from a DataGridView configured on another Form

I have Form1 that has a dataGridView and a button to add content to this Grid. When I select this button, I call the Form2 that has 2 TextBox and a ComboBox to fill in the Name, Directory, and Format (for example) in addition to a O...
asked by 04.07.2017 / 02:33
1
answer

Insert data into a table with foreign key in ID

I'll try to be as objective as possible so not many codes will I put (because the original is really too big). I'm doing a simple registration program that has:  - 1 datagridview to select the desired customer from a list of records  - 1...
asked by 17.03.2017 / 14:36
1
answer

Passing data from a gridview to another gridview

I have a datagridview1 that searches the database for the data and shows the information, I want it to click the add button it picks the selected row in the first datagridview1 and passes it to another datagridview2.     
asked by 18.05.2017 / 21:49
1
answer

C # - Display search results in DataGridView (SELECT SQL)

Hello! I'm starting effectively in C # and I already have small projects. I can already connect to the remote database, I can already execute queries, I just can not get the result of a Select and show in a DataGridView. Honestly, if there is a...
asked by 15.03.2016 / 22:33
1
answer

Options menu with right mouse button on datagrid

I need to create a menu with a few options so that when you select a record in a datagrid and right click on that record a menu with options for that record will appear.     
asked by 25.05.2015 / 01:42
1
answer

How to replace the CheckBox with a String

I need to display "Active" or "Idle" in the Status column of the DataGridView , how do? This"Situation" column is Boolean type: This is the Code where I populate the DataGridView : private void PreencherDataGridView() {...
asked by 15.06.2018 / 23:10