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
2 answers

c# Scroll bars keep resetting when DataGridView updates

I am binding my grid as such: dataGridView1.DataSource = new BindingSource(); dataGridView1.DataSource = tableData; (tableData is an ArrayList of custom objects) The dataSource is getting updated very often (the file it is reading from gets updated…
jpints14
  • 1,361
  • 6
  • 15
  • 24
3
votes
3 answers

Proper way to select previous and next row using a hotkey via DataGridView

Somewhat new to .NET 4.0 C# development and have a quick question. I am working on a basic windows form application where I am using a DataGridView to view data stored in an Access Database. I would like to use ALT+N to select the next row down and…
Tommy2Fast
  • 51
  • 1
  • 8
3
votes
1 answer

C# DataGridViewLinkCell Display

Is it possible to have a DataGridViewLinkCell display something like search but the link be http://google.com? I would rather the DataGridView not be littered with actual links.
poy
  • 10,063
  • 9
  • 49
  • 74
3
votes
1 answer

Force Bound DataGridView to Generate Columns and Rows

I am programmatically creating a DataGridView object and then binding it to a DataTable using the grid's DataSource property. After creating the grid, I am adding it to a WinForms's control collection, ie: Form1.Controls.Add(grid); I want to apply…
HydroPowerDeveloper
  • 3,302
  • 7
  • 31
  • 38
3
votes
2 answers

Programmatically setting the record pointer in a C# DataGridView

How do I programmatically set the record pointer in a C# DataGridView? I've tried "DataGridView.Rows[DesiredRowIndex].Selected=true;", and that does not work. All it does is highlight that row within the grid; it doesn not move the record pointer…
Alvin S
  • 1,189
  • 1
  • 10
  • 16
3
votes
1 answer

Create a datagridview cell which can contain several clickable links?

Is there a way to have a column/cell in a DataGridView which can contain multiple links each of which is individually clickable? Example mocked up in Excel:
hawbsl
  • 15,313
  • 25
  • 73
  • 114
3
votes
1 answer

Nhibernate bind to DataGridView

Why there is no any tutorial about binding NHibernate to DataGridView in Winforms. Only I want to use it? I know that this is matter of binding collection to DataGridView. But I have problems with making CRUD. I have database SQLite+table with…
userbb
  • 2,148
  • 5
  • 30
  • 53
3
votes
3 answers

InvalidOperationException - When ending editing a cell & moving to another cell

I made a program in which I wanted to manually update the Data Grid View. -I have a Method to Refresh the DGV by clearing it and then reinserting the data. -Using the designer, I made an event handler for the DGV's CellEndEdit. Inside the Event…
random dude
3
votes
2 answers

vb.net rebind datagrid to display changes in vb.net

I have the following code that refreshes the datagrid in the form after the update is made to the database. My question is why do I have to clear the datasource and then re-add it to get the changes to display. I would think that the refresh…
Lance Collins
  • 3,365
  • 8
  • 41
  • 56
3
votes
2 answers

How can I bind a Queue to a DataGridView in C#/Winforms?

I have a standard C# queue, declared like this: private Queue _solutionQueue = new Queue(); Now I want to bind this queue to an DataGridView, which is placed inside a winform. With "bind" i mean that everytime i dequeue or…
LMW-HH
  • 1,193
  • 2
  • 15
  • 31
3
votes
1 answer

Enum description in DataGridView

I have a problem with enum description. I want that the dataGrid show me the enum description and not "ToString()" of the enum. enum DirectionEnum { [Description("Right to left")] rtl, [Description("Left to right")] ltr } class…
user1134316
3
votes
1 answer

Resizing DataGridView columns without affecting adjacent ones?

I'd like to implement a feature whereby allowing a user to resize a DataGridView column, but without affecting the adjacent columns. I've noticed in many programs that you can resize a specific column, and all the columns to the left or right will…
Mirrana
  • 1,601
  • 6
  • 28
  • 66
3
votes
4 answers

accessing Datagridview cell value while its value is being edited

I have a form with a datagridview and when user start entering value for first cell in first row , , can also press f2 which submit that value , but i cant access cell value unless user hit tab and go to another cell following is my code for…
Sadegh
  • 6,654
  • 4
  • 34
  • 44
3
votes
14 answers

How to number the rows of DataGridView?

How to number the rows of datagridView ? That when I add additional row the number increments ?
user891757
  • 259
  • 2
  • 6
  • 15
3
votes
5 answers

How can I save my datagridview without any Databases?

I have created one C# Windows form that have one DataGridView I can add or remove some row from this DatagridView, but now I wonder how can I save my changes, so every time I open my window I can see my added row. P.S.: I must mentioned that I don't…
Am1rr3zA
  • 7,115
  • 18
  • 83
  • 125