Questions tagged [datagridviewcolumn]

In WinForms DataGridViewColumn class represents a column in a DataGridView control.

In WinForms DataGridViewColumn class represents a column in a DataGridView control.

516 questions
1
vote
1 answer

Bind DataSet column types to DataGridViewColumns?

I have a set of data coming into a DataGridView from another DataGridView (described here, question solved). I now wish to add two new columns to my DataSet, one Integer, one Boolean, with the Integer column being of type…
Frosty840
  • 7,965
  • 12
  • 50
  • 86
1
vote
1 answer

Updating DatagridView Image Column in C#

I'm trying to get a datagridview updated that is populated by the datatable. When launching it shows the image of (Properties.Resources.database) and not (Properties.Resources.completed). DataTable dtStores = new DataTable(); …
Jay
  • 11
  • 1
1
vote
2 answers

Creating Column in DataGridView in C#

I have a problem in creating a datagrid column in c# here is my code. DataGridViewColumn newCol = new DataGridViewColumn(); newCol.HeaderText = txtHeader.Text; newCol.Width = Convert.ToInt16(cboWidth.Text); dgWorkArea.Columns.Add(newCol); On my…
Mark
  • 11
  • 1
  • 2
1
vote
1 answer

c# datagridview having different datasources for different columns

I have a datagridview which has multiple text columns and a single comboboxcolumn. I need to specify a datasource for the iems of the comboboxcolumn and another datasource for the other text columns. I have tried the following sample code but it…
1
vote
2 answers

Disable Column Header click on datagridview vb.net

I have created a command button for each row on a datagridview. The code is working fine. Private Sub dgv_employees_CellClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles…
1
vote
1 answer

How Can I Set DataGridViewCellEventArgs As Handled?

I want to mark a DataGridViewCellEventArgs as handled so that nothing downstream from it interferes with the way it was handled. The DataGridViewCellEventArgs class does not have a handled property, and neither does its base class. The event that I…
1
vote
1 answer

How can I get all the values of the 1st column of every single row in a dataGridView?

I have a DataGridView that looks like the following. I am required to get ID value of every row and perform an operation with it in every loop. I am able to get the ID value if I select a particular row. However what I am trying to do is…
CodeBreaker
  • 87
  • 2
  • 11
1
vote
1 answer

How to bind a wpf datagrid to a column that contains combination of combo box and test box via mvvm

In my datagrid, I have a textbox column and another column that should contain combination of combo box and text box which should be set dynamically. For instance, I'm letting user to set the status of the machine. So, State and Value are the…
jamilia
  • 359
  • 4
  • 14
1
vote
2 answers

Show an empty cell in DataGridViewImageColumn with null values

My Form has a DataGridView control and Column 0 is of type DataGridViewImageColumn. When the Form is first displayed, an empty DataGridView control is displayed and Column 0 has a rectangle with a red X in it. The same icon is displayed when I add…
Dan Z
  • 101
  • 13
1
vote
1 answer

How to add a CellContentClick Event per Column in a DataGridView

Is it possible to set a CellContentClick Event method per Column, e.g. as a method of a DataGridViewColumn. This method would run if a CellContentClick happens for only this column instead of the whole DataGridView like the normal…
Langley
  • 49
  • 1
  • 5
1
vote
0 answers

What would cause a data grid error on an image column only when deployed on a Windows 10 machine?

I have a C# windows forms app with a data grid. One column of the grid is an image column which I put a bitmap in. It works fine on the Windows 10 machine I developed it on and when I deploy it on Windows 7 machines, but on all other Windows 10…
1
vote
2 answers

Changing DataGridViewButtonColumn's Button Text Per Row

I have a DataGridView with one column of type DataGridViewButtonColumn. I want to put a text on the button. I've tried in the Edit Column options to put the text in the Text properties. I have even tried swtteing UseColumnTextForButtonValue =…
hadi
  • 137
  • 2
  • 4
  • 8
1
vote
1 answer

Updating all of the cells to database from datagridview

I have created to DatagridviewComboBoxColumns in 2 tables (in this case 'moduly' and 'zlecenia' tables) and gets inserted values from 'projekty' table. But when I i click on Update button it doesn't save in mysql database (in projekty table saves…
Prochu1991
  • 443
  • 5
  • 20
1
vote
1 answer

How to change cell type of a databound column

I have a datagridview that is bound to a dataset via a table adaptor which in turn linked to a SQL table. I want to change the cell type of the status and priority columns to comboboxes. I have tried this: private void…
James Morrish
  • 455
  • 6
  • 24
1
vote
1 answer

Get cell value from gridview and convert it into int

I have a gridview, that has 4 columns, the first column has a select button, and I need to get the values of the fourth column, depending on which button do u press. And i need to get or convert the value of the fourth column into int. Thanks for…
debiione
  • 13
  • 3