datagridview Questions
9
I recently migrated a Project from .NET 4 to .NET 4.7.2 which introduced a change in the WinForms DataGridView Headers.
Pre Migration looks like this:
As you can see, the Header of the cell i cu...
Sapir asked 25/7, 2018 at 7:40
3
Solved
How to calculate dgv.Rows.Height
int x = dgv1.Rows.Height
Rows.Height or dgv1.RowsHeight does not exists.
Zinovievsk asked 18/6, 2012 at 13:19
5
Basically I have a datagridview which displays data from a datatable. Each cell in the datatable is a decimal with roughly 10 decimal points, how can I use the datagridview to display this data to ...
Akan asked 13/8, 2014 at 8:26
15
Solved
I have a DataGridView. Some of the cells receive their data from a serial port: I want to shove the data into the cell, and have it update the underlying bound object.
I'm trying something like th...
Chaliapin asked 4/10, 2009 at 12:10
2
Solved
Is it possible to have both DataGridViewComboBoxCells and DataGridViewTextBoxCells in a single DataGridViewColumn? Or am I absolutely restricted to having one type per column?
Plagio asked 3/10, 2011 at 6:17
3
Solved
I have a winforms application that uses a datagridview. When I access the EditedFormattedValue of a cell while it is in edit mode, sometimes the whole cell turns black. Is this a feature of the dat...
Schoolmate asked 8/7, 2010 at 20:36
6
For c = 0 To grd.Columns.Count - 1
grd.Columns(c).Resizable = DataGridViewTriState.True
Next c
That allows all the columns in my DataGridView to be resizable EXCEPT the last column. Why?
I DO g...
Upholstery asked 10/5, 2011 at 14:10
10
Solved
After entering data into all the textbox, and after clicking the submit button, it won't immediately show in the datagridview, I need to reopen the form in order to see the new inserted row. What c...
Reni asked 23/1, 2014 at 3:53
5
I want to set the datagridview values in number format. Currently I am getting this:
I want something like this:
I have used this code:
dgvmain.DefaultCellStyle.Format = "#.##0";
And this ...
Until asked 18/8, 2013 at 12:24
7
Solved
I'd like to deselect all selected rows in a DataGridView control when the user clicks on a blank (non-row) part of the control.
How can I do this?
Carnallite asked 30/11, 2010 at 14:16
7
Solved
I am using just a simple DataGridView to hold a bunch of data (Funny that).
I have decimals in a particular column. But when it comes to ordering by that decimal column, it orders it incorrectly....
Balthazar asked 7/1, 2010 at 4:54
7
Solved
In winforms, you need to click the combobox twice to properly activate it - the first time to focus it, the second time to actually get the dropdown list.
How do I change this behavior so that it ...
Pantsuit asked 22/10, 2012 at 4:53
4
Solved
i have a data gridview with 4 columns first 2 columns are combobox columns, third column is textbox column and 4th column is button column.In form load i have to disable the entire button column of...
Ginelle asked 21/9, 2012 at 6:28
3
Solved
I have a DataGridView that I use in a C# Winforms project. The grid does NOT autogenerate columns. I have manually set the column names and properties.
This includes the DefaultCellStyle for the ...
Emmaline asked 21/3, 2012 at 19:36
3
Solved
When the application is run, the DataGridView is bound to a DataTable. Later I add more columns to the DataTable programmatically and it is reflected in the underlying data - i.e. the column Ordina...
Handle asked 31/1, 2009 at 18:47
13
I found a lot of questions about how to resize the form when a child control resizes, but I'm trying to do something much simpler (maybe so simple people don't even ask it :| )
I'd like to automat...
Wasp asked 18/11, 2011 at 13:48
3
Solved
I am trying to make the height of my DataGridView AutoSize based on the amount of rows it contains. Currently, I was able to accomplish this with the following line:
dataGridView_SearchResults.Aut...
Noctule asked 7/8, 2016 at 16:53
21
Solved
I have a DataGridView on Window form which is populated with 30 columns and thousands of rows.
ScrollBars property is set to Both, but still horizontal scroll bar is not visible. even I am unable t...
Mononuclear asked 7/3, 2011 at 10:57
1
Solved
When I do a character search in the DataGridView, I want only the searched specific characters to be selected (I give it a red box), without selecting all characters in cell. How do I do it?
I wrot...
Tichonn asked 6/6, 2023 at 5:52
6
Solved
This question is closely related to these two (this and this) but I don't think they give a satisfying answer.
I have a DataGridView (i.e. a table) with several columns (DataGridViewTextBoxColumn)...
Terrazzo asked 20/9, 2013 at 16:23
10
Solved
I'm working on a program with DataGridViews.
In one DatagridView there is a DataGridViewTextBoxColumn, which is enabled to be edited by the user. When the user is done with typing the numbers into...
Mikiso asked 24/4, 2011 at 16:2
6
I'm setting the following properties for a DataGridView in my C# project ...
sampleDataGridView.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
sampleDataGridView.ColumnHea...
Cellule asked 5/3, 2012 at 9:3
19
I have a datagridview on my form and I populate it with this:
dataGridView1.DataSource = students.Select(s => new { ID = s.StudentId, RUDE = s.RUDE, Nombre = s.Name, Apellidos = s.LastNameFathe...
Honeymoon asked 5/4, 2011 at 14:1
15
Solved
I am using a BindingSource control (reference here) to populate my DataGridView control. There are around 1000+ records populating on it. I am using threading to do so. The DataGridView performs ve...
Tronna asked 19/4, 2012 at 11:24
13
Solved
Is it possible to show row number in the row header of a DataGridView?
I'm trying with this code, but it doesn't work:
private void setRowNumber(DataGridView dgv)
{
foreach (DataGridViewRow row in...
Grosz asked 6/3, 2012 at 10:16
© 2022 - 2025 — McMap. All rights reserved.