Questions tagged [datagridview]

DataGridView is a Windows Forms control used to display and edit tabular data.

DataGridView is a Windows Forms control found in the .NET Framework starting at version 2.0. It is used to display and edit tabular data from many different kinds of data sources. It provides a rich set of features such as sorting, filtering, grouping, and editing data.

Useful links

20349 questions
3
votes
1 answer

C#: DataGridView DataSource Update - DataTable, List, BindingList and BindingSource?

I am still baffled finding out how to get a DataGridView updated automatically when changing the content of its DataSource without explicitely triggering DataGridView.Update(). It seems there is no difference at all between DataTable, List,…
tar
  • 156
  • 2
  • 13
3
votes
1 answer

Set default value in DataGridView combo box

I'm using DataGridView in windows form to allow the user to add n numbers of rows with values enter by the user. One of the column of DataGridView contains combo box, which is displaying its items by using database. I'm using the following code in…
Dusk
  • 2,191
  • 6
  • 38
  • 57
3
votes
3 answers

Combo box is not displaying default value in DataGridView in C#

I'm trying to allow user to select value from DataGridViewComboBoxColumn for each new row. I've bound ComboBox in GridView to database, but whenever I enter new row I see DataGridViewComboBoxColumn with no initial value. I have to set the value…
Dusk
  • 2,191
  • 6
  • 38
  • 57
3
votes
3 answers

Show tooltip when datagridview cell is selected

How can you show the tooltip for datagridview when cell is selected, not from mouseover but from using the arrow keys?
Troy Mitchel
  • 1,790
  • 11
  • 50
  • 88
3
votes
3 answers

Algorithm for coloring DataGridView to see visually a whole distribution of cell values

I have a matrix of numbers. A DataGridView is used for displaying it. I need an algorithm which for each cell calculates its BackColor, based on the value of the cell. So, when looking on the DataGridView I will be able to see visually a whole…
Peter17
  • 3,052
  • 9
  • 47
  • 77
3
votes
2 answers

In C#, how to add Intellisense to DataGridView cells?

I would expect this would be a common need. Can anyone help or point me to a page that explains how to do this?
JohnnyM
  • 28,758
  • 10
  • 38
  • 37
3
votes
2 answers

DataGridView ComboBox EditingControlShowing events

I have a basic WinForms app with d DataGridView (named dgvHardware) control on it, bound to this control is this code: private void dgvHardware_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e) { if…
Fuginator
  • 229
  • 3
  • 5
  • 15
3
votes
3 answers

c# DataColumn: generate a new GUID as default value?

My problem: I have a DataSet with multiple DataTables in it. All of these DataTables have a DataColumn named "Id" with a DataType of System.Guid. A short example of such a table: +--------------------+ | User | +--------------------+ |…
cimnine
  • 3,987
  • 4
  • 33
  • 49
3
votes
3 answers

Generating row numbers automatically in the header of dataGridView

I'm new to using the C#/.NET programming Language and I have created a DataGridView for adding, editing and deleting records. I am using Visual Studio 2010 for coding. I have put in an unbound column for row number and have this method for…
Kinyanjui Kamau
  • 1,890
  • 10
  • 55
  • 95
3
votes
3 answers

Refresh DataGridView in Windows form

I have two forms let it be Form A and Form B. When I click save button on Form B I want the DataGridView of Form A to refresh. Which method should I use?
thinzar
  • 1,530
  • 5
  • 25
  • 46
3
votes
3 answers

How to add different icons/images to datagridview row header in c#?

I want to add different image to c# windows form datagridview row header dynamically. it should be do like check any cell value and if it>10 display some image,else display other image.How to do this one?please help me...........
hmlasnk
  • 1,160
  • 1
  • 14
  • 33
3
votes
1 answer

DataGridView change a cell content that's condition up to another cell

I have a list of products and I am trying to add them into a datagridview. Each product has a property like id, name, brand, price, stockAmount, isPackaged, and product type properties. What i want is to make invisible the IsPackaged boolean and if…
Demir
  • 799
  • 3
  • 16
3
votes
2 answers

How to force a "refresh" in a DataGridView

I am a newbie doing my first C# project (with minimal experience in Haskell and C as well) looking for guidance on how to implement a small feature on my program. I have a DataGridView table (with 3 columns of checkboxes among other stuff) for the…
3
votes
4 answers

Failed to populate DataGridView

I am population DataGridView from DataTable, but getting following error: At least one of the DataGridView control's columns has no cell template private void PopulateGridView(DataTable dt) { if (dt != null) { …
Scorpion
  • 4,495
  • 7
  • 39
  • 60
3
votes
3 answers

How to make ComboBox column in DataGridView?

I have DataGridView with 2 columns: Fname | Age I need to show Age in ComboBox (that i can pick the age between 1 to 100). When I press the button (save button for example) the Age value will be saved to the database. (I work with access) Can i get…
Gali
  • 14,511
  • 28
  • 80
  • 105