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

Getting text only from a specific column of DataGridView

I have a DataGridView that is populated with 4 columns and multiple rows of data. I want to iterate through the DataGridView and get the cell value from a specific column only, since I need this data to pass into a method. Here is my code: foreach…
Goober
  • 13,146
  • 50
  • 126
  • 195
3
votes
1 answer

VB.NET Winforms DataGridView Select new row on Sorted DataGridView

Alright I have a DataGridView, where the user can click on the column headers to sort. When they add a new row while a sort is applied, the record isn't created until the moment they validate the row(which they cannot do till they exit the newRow).…
3
votes
2 answers

Is it a good practice to do following idea based on ListView?

I am planning to show, or to say, dump a set of same objects in my application to user. I need a control that after adding data to it, changing the data in a specific cell and row can be done programmatically. At the moment I am using a ListView and…
Dumbo
  • 13,555
  • 54
  • 184
  • 288
3
votes
3 answers

How to see DataGridView changes without changing row

I have a DataGridView with a few DataGridViewComboBoxColumn's. The columns have their DataSource set so that they will display certain values to choose from, however the DataGridView itself does not have its DataSource set to anything. I manually…
Brandon Moore
  • 8,590
  • 15
  • 65
  • 120
3
votes
3 answers

Finding text from the datagrid view in vb.net

I have a data grid view in one windows form named "GridViewForm". When the user search for the text from the search box from another window form named "FindForm", I want to highlight all the matching result in the data grid view. The search type can…
nightfire001
  • 759
  • 3
  • 20
  • 50
3
votes
5 answers

How to check whether Check box inside data grid view is checked or not

How can i check for the bool condition of a check box which is in datagridview. I would like to have true if checked and false if it was unchecked. Can any one help me. Is it possible to handle this in dataGridView_CellContentClick
Developer
  • 8,390
  • 41
  • 129
  • 238
3
votes
4 answers

C# DataGridView.Rows.ToString()

I am trying to store the values of each of my rows in a string. If I try to do DataGridView.Rows.ToString() I get System.Windows.Forms.DataGridViewRowCollection Not even close to what I need. Any ideas?
Kyle Uithoven
  • 2,414
  • 5
  • 30
  • 43
3
votes
1 answer

Real-Time DataGridView?

I'm looking for tutorial or example showing how to use a datagrid view to display quickly changing data which is stored in business objects. Here is an example: Say I have the following classes: public class StockPosition { public string…
Ahmad Houri
  • 1,117
  • 4
  • 16
  • 26
3
votes
2 answers

In DataGridView turn ReadOnly property of column to false when adding new row, on updating its true (c#.net)

I have set the readonly property of 2 datatable columns to true. List.Columns[0].ReadOnly = true; List.Columns[1].ReadOnly = true; But i only want them to be read only when user is trying to update, User can add new rows to dataGridView so…
PUG
  • 4,301
  • 13
  • 73
  • 115
3
votes
1 answer

Load xml schema and data into DataSet (and datagridview)

I have a datagridview populated with data from an .xml file. The data is a list of MyObjects, where MyObject is a C# class I have. This initially was done without a schema, so no type information :( Means I don't get the benefit of auto-generated…
akevan
  • 691
  • 1
  • 9
  • 21
3
votes
1 answer

Retrieve datarow behind datagridviewcombobox while databound

I have a databound DataGridView. One of its columns is DataGridViewComboBox. The DataGridViewComboBox is also databound. Everything is working just fine until I wish to retrieve the DataRow behind the DataGridViewComboBox selected item (not the…
Daniel
  • 1,391
  • 2
  • 19
  • 40
3
votes
4 answers

how to delete row from datagridview with a delete button?

I've got a DataGridView with a BindingSource binding it to a DataTable. I've put a Delete button on my form and I want it to delete the currently selected row when clicked, something like this: if (dgvResourceSettings.CurrentRow != null &&…
Rory
  • 40,559
  • 52
  • 175
  • 261
3
votes
1 answer

Change behaviour of editable column of DataGridView

I have a DataGridView, in which I have a column. This column is not readonly, and the purpose of it is to be able to write text in every cell. When I select a empty cell and start typing, it works as expected. However, when there already is text in…
3
votes
5 answers

Datagridview error System.IndexOutOfRangeException: Index 0 does not have a value

I am getting one error when I am trying to populate binding source. The exception is as follows; System.IndexOutOfRangeException: Index 0 does not have a value. at System.Windows.Forms.CurrencyManager.get_Item(Int32 index) at…
VJOY
  • 3,752
  • 12
  • 57
  • 90
3
votes
2 answers

control to show steps to do something in winforms

i want to show steps on how to cook something in winform c# .net as steps. Something like a set of text area would be nice but: -> list box considers the whole string of one step as one item so user needs to scroll horizontally to view the whole…
PUG
  • 4,301
  • 13
  • 73
  • 115