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

What's the best way of forcing a DataGridView Cell to accept numeric input only?

Currently I'm using: Private Sub dgvStock_CellEndEdit(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvStock.CellEndEdit Select Case Me.dgvStock.Columns(e.ColumnIndex).Name Case…
Simon
  • 6,062
  • 13
  • 60
  • 97
3
votes
3 answers

How to populate each DataGridViewComboBoxCell with different data?

i have two DataGridViewComboBoxColumn that i add at run time i need the items of the first DataGridViewComboBoxColumn to stay the same in all the rows of the gridview but i want the items of the second DataGridViewComboBoxColumn to be different from…
sara
3
votes
2 answers

Change the three dots (ellipses) (...) to custom characters in VB.Net DataGridView when cell content is truncated

I am developing a project in VB.Net and I am using Gujarati fonts (non-Unicode). I have placed a DaraGridView (DGV) and displaying the data stored in database in DGV. In DGV, if the contents of the cell is truncated, the DGV shows ellipses (three…
Nikunj Bhatt
  • 188
  • 4
  • 16
3
votes
1 answer

DataGridViewColumn index gets changed after data clearing

After filling DataSet, I insert two DataGridViewComboBoxColumns into some particular index: dgvPayments.Columns.Insert(1, cmbPayMethod); dgvPayments.Columns.Insert(3, cmbPayType); dgvPayments.Columns.Insert(5, cmbMonth); I have a cell click event…
Hilal Al-Rajhi
  • 437
  • 6
  • 25
  • 49
3
votes
2 answers

How to Stop DataGridView editing after checked cell?

I use ContexMenuStrip on DataGridView to delete some rows but it doesn't work correctly. Every time if I checked 3 rows, after selecting the ContexMenuStrip it only deletes 2 rows. When I do this code without the ContexMenuStrip (by Button) that…
saeid
  • 99
  • 1
  • 6
3
votes
1 answer

WinForms DataGridView throwing IndexOutOfRangeException

first timer here on Stack Overflow (although I've been lurking for ages). I'm developing a little application which contains two DataGridViews. The second DataGridView is filled via a binding on a list of a custom class objects (the user presses a…
3
votes
1 answer

Using DataGridViewAutoFilter with Equin BindingListView

I'm attempting to use DataGridViewAutoFilter with my DataGridView, but in order to do so, I need a data source that implements IBindingListView. In order to do that, I'm using Equin.ApplicationFramework BindingListView which, as far as I can tell,…
Prdufresne
  • 296
  • 2
  • 15
3
votes
1 answer

C# DataGridView how to illuminate current List

I would like to highlight the method that is being implemented on datagridview right now. This is List : public List functions = new List(); And inside i have a methods. by adding for example. functions.Add(waypoint1); My…
3
votes
1 answer

DataGridView1.CurrentCell and BeginEdit doesn't work if I move with Tab

C#, WinForms. Maybe it's a stupid and trivial problem but I can not get out! I have a DataGridView1with 4 columns. I check if the value of each row, in column 1, is identical to the value of the previous row in column 2. If yes, a MessageBox appears…
Wiccio
  • 311
  • 4
  • 14
3
votes
1 answer

Function painting "Dependent cells" on datagridview

I would like to implement in my DataGridView a feature similar to "Dependent cells" from MsExcel like on the following picture. The best would be some kind of painting function that would take destination and dependent datagridviewcell addresses as…
mdziadowiec
  • 396
  • 3
  • 10
3
votes
5 answers

VB.net : How can I prompt a user if they are about to close their program with unsaved data?

I working working with Visual Basic 2010 Express. I have a DataGridView that is linked up with a local SQL database I've created. I have it currently where the user can click a button to save their data to the db, but am unsure how to prompt them…
daveomcd
  • 6,367
  • 14
  • 83
  • 137
3
votes
1 answer

C# - Most efficient way of changing the value of a cell in each row within a DataGridView

I'm looking for some advice on the most efficient way of changing the cell value of each row within a DataGridView. I think that there could possibly be different ways of achieving this but I don't want to start coding it without some advice and end…
Paul Alexander
  • 2,686
  • 4
  • 33
  • 69
3
votes
4 answers

How to disable the select highlight (blue) in datagridview

I have a datagridview which only purpose is to display information from the database. I have also added extra column which has "View" link in every row, for some reason. So basically the datagridView's purpose is just for the user to click "View"…
Syntax Error
  • 105
  • 1
  • 4
  • 12
3
votes
2 answers

Filtering WinForm DataGridView

I have a DataGridView control that is bound to a custom typed list (that inherits BindingList). I would like to be able to filter rows based on a simple column value (bool type). Ultimately, the fonctional goal is to be able to mark an item as…
Patrice Cote
  • 3,572
  • 12
  • 43
  • 72
3
votes
1 answer

Win Forms DatagridView. How to add custom column from designer?

I've already created my custom DataGridViewSliderColumn class, which renders a TrackBar inside the cell. My question is, how can I set the type of a column to my custom DataGridViewSliderColumn in the designer? (I have defined a lot of columns on…
Rbn3D
  • 73
  • 1
  • 5