datagridview Questions

4

Solved

I'm having a datagridview with combobox column in it. This column is databound. I want to set the width of the dropdown list as per the largest item width in the list. For a normal combobox to achi...

8

Solved

I have a DataGridView, which is not set to ReadOnly. None of its columns are set to ReadOnly, and the object it is bound to is not set to ReadOnly. Yet, I can't edit the DataGridView items? The .Da...
Impignorate asked 27/5, 2009 at 12:23

7

Solved

I have not even an idea where to look to fix this error. Recently i get following exception after i've clicked the checkbox in a DataGridViewCheckBoxColumn to check it and leave that cell: Syste...
Jamiejamieson asked 5/11, 2014 at 15:34

3

Solved

I have Form1 and Form2. Form1 has a dataGridView and a button for opening Form2. I have written a method in Form1 as below that perfectly refreshes the dataGridView: public void RefreshGrid() { ...
Seigniorage asked 18/11, 2014 at 17:36

11

Solved

I have created an application in Visual Studio (C#) that makes use of a datagridview. Now, when I assign the DataSource of that datagridview, it automatically selects the first row, and executes my...
Milldam asked 19/9, 2012 at 12:29

7

Solved

I am wondering if it is possible to have a dataGridView column to adjust automatically its width to its content and at the same time being resizable by the user ? Here what i have tried so far : ...
El asked 18/7, 2013 at 14:27

6

Solved

I have a DataGridView in a Winforms app that has about 1000 rows (unbound) and 50 columns. Hiding a column takes a full 2 seconds. When I want to hide about half the rows, this becomes a problem. ...
Betthel asked 20/3, 2010 at 13:45

6

I have 10 records of data in a DataTable which has 3 fields "Foo", "Bar", and "Baz". If I connect wire this into a DataGridView I see 10 rows and 3 columns, and the column headers display the name...
Mcspadden asked 12/5, 2009 at 16:27

3

Solved

I've DataGridView that bound a List<myClass> and i sort it by "Priority" property in "myClass". So I want to drag an "DataGridViewRow" to certain position to change it's "Priority" property. ...
Nordin asked 25/10, 2009 at 13:39

5

I'm using this code: // Cell value change event. private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) { if ((bool)dataGridView1.CurrentCell.Value == true) Messa...
Shien asked 24/6, 2013 at 12:11

3

Solved

I have a DataGridView with the datasource set to a binding source of data. My problem is I cannot get most of the columns to resize. Several of the columns don't show a resize cursor, while two oth...
Tinytinya asked 16/7, 2013 at 15:11

4

I am putting this up because it took far too long to find the answer on the web and this is probably a common problem - it is the second time i have experienced it on my app. When a new row with a...
Karlotta asked 20/10, 2013 at 10:49

19

Solved

I have a datagridview that is a full row select. How would I grab the data from only a certain cell no matter what cell in the row was clicked on since it highlights the entire row.
Albertina asked 5/10, 2011 at 5:42

5

Solved

I'm trying to bound a DataGridViewComboBoxColumn to an instance of Foo, but when i set a value on the grid i got a ArgumentException telling me that i can not convert from String to Foo. var data ...
Overcoat asked 10/3, 2009 at 16:34

3

Solved

I have a Winforms application which has a DataGridView. The DataGridView is not bound to a datasource. I'm reading a text file and according to each line in the file, I'm placing the values of each...
Husbandry asked 10/5, 2015 at 22:19

11

Solved

In the DataGridView, even if you set the grid as readonly there is a black triangle at the rows headers which is shown at the current row. I'd like to avoid it to be shown, also I'd like to avoid ...
Deltoid asked 28/4, 2011 at 21:12

4

I am programmatically adding columns to a DataGridView and then binding to a list. By default, the SortMode of the columns are Automatic. But when I run my app, clicking on the headers does nothing...
Kellar asked 22/9, 2010 at 15:25

12

Solved

I have a DataGridView bound to an ObjectDataSource some of the columns are hidden including the ID column. The problem is that the ID column shows up even when its visible property is set to false....
Galwegian asked 15/6, 2011 at 14:22

3

Solved

This code CurrentSelectedRow = Me.dgvPreviouslyCut.CurrentRow.Index stores the current selected row that has been clicked by the user in a data grid view control . After refreshing the datasourc...
Fayfayal asked 10/3, 2014 at 15:44

6

Solved

How to change DataGridView cell ForeColor based on whether new cell value is > or < than current/old cell value? Is there an event which passes the new value before the current is changed, so I ...
Artima asked 14/8, 2011 at 22:29

5

Solved

I have a DataGridView(tblLoggedJobs) that displays a list of jobs logged by a user. I need the admins to be able to update these jobs to display any updates to the job or note if the job is closed....
Divebomb asked 28/4, 2015 at 2:41

9

Solved

I have tried to do it without success. Is it possible ?
Lection asked 8/8, 2009 at 2:40

3

Solved

I've just noticed that DataGridViews have a default shortcut so that whenever you press Ctrl + H, the DataGridView's editing control backspaces, and can delete your entire selection within the cell...
Disorientate asked 12/4, 2010 at 2:20

5

Solved

We'd like to override DataGridView's default behavior when using a mouse wheel with this control. By default, the DataGridView scrolls a number of rows equal the SystemInformation.MouseWheelScrollL...
Disreputable asked 25/9, 2008 at 18:33

10

I was wondering whether it is possible to remove the unused space ( the gray space ) of the DataGridView control in C#. I have to make the DataGridView display the white table only. Any suggestions...
Sitdown asked 29/1, 2010 at 15:3

© 2022 - 2025 — McMap. All rights reserved.