The 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.
26
votes
5answers
37k views
How to bind a string list to a datagrid?
it looks pretty easy and there must be a way to do it: i have a simple List<string> and i would like it to be displayed in a column in dataGrid. if these were some more complex objects i would ...
33
votes
3answers
32k views
simple DataGridView refresh question
whats the best way to refresh a DataGridView when you update the base data source?
i'm updating the datasource frequently and wanted to display the outcome to the user as it happens.
i've got ...
12
votes
4answers
19k views
DataGridView bound to a Dictionary
I have a Dictionary that contains items and prices. The items are unique but slowly get added and updated through the lifetime of the application (that is, I don't know the item strings in advance). I ...
34
votes
8answers
17k views
Horrible redraw performance of the DataGridView on one of my two screens
I've actually solved this, but I'm posting it for posterity.
I ran into a very odd issue with the DataGridView on my dual-monitor system. The issue manifests itself as an EXTREMELY slow repaint of ...
31
votes
2answers
13k views
List<T> vs BindingList<T> Advantages/DisAdvantages
Can someone describe what the difference between the two are for my project.
Currently I have a List<MyClass> and set the BindingSource to that and a DataGridView to the BindingSource.
I have ...
8
votes
1answer
4k views
WinForms DataGridView - databind to an object with a list property (variable number of columns)
I have a .NET class I'd like to show in a DataGridView, and the default databinding - setting the DGV's DataSource to the object - produces 90% of my requirements (i.e. it's outputting the public ...
13
votes
2answers
35k views
Filtering DataGridView without changing datasource
I'm developing user control in C# Visual Studio 2010 - a kind of "quick find" textbox for filtering datagridview. It should work for 3 types of datagridview datasources: DataTable, DataBinding and ...
15
votes
2answers
30k views
How to bind list to dataGridView?
I seem to be running around in circles and have been doing so in the last hours.
I want to populate a datagridview from an array of strings. I've read its not possible directly, and that I need to ...
2
votes
1answer
13k views
How do I use XML as a datasource for a datagridview in a winforms project?
How do I link an editable datagridview to an XML file in a winforms project?
34
votes
9answers
34k views
How do you automatically resize columns in a DataGridView control AND allow the user to resize the columns on that same grid
I am populating a DataGridView control on a Windows Form (C# 2.0 not WPF).
My goal is to display a grid that neatly fills all available width with cells - i.e. no unused (dark grey) areas down the ...
9
votes
10answers
24k views
Printing a .NET DataGridView
I am fairly new to .NET and C#, but I have a DataGridView that I would like to print. What would be the best way to go about doing so?
5
votes
2answers
7k views
How to sort databound DataGridView column?
I know that there are a lot of questions on this topic. I have been through all of them but nothing seems to help.
How to sort by clicking on column header?
How should I modify this code to do the ...
22
votes
8answers
75k views
C# How to change row color in datagridview?
I would like to change the color of a particular row in my datagridview. The row should be changed to red when the value of columncell 7 is less than the value in columncell 10. Any suggestions on how ...
5
votes
2answers
5k views
DataGridView keydown event not working in C#
DataGridView keydown event is not working when I am editing text inside a cell.
I am assigning shortcut Alt+S to save the data, it works when cell is not in edit mode, but if it is in edit mode ...
4
votes
7answers
72k views
DataGridView checkbox column - value and functionality
I've added a checkbox column to a datagridview in my C# form. The function needs to be dynamic - you select a customer and that brings up all of their items that could be serviced, and you select ...