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

Host custom controls on DataGridView which populate data from DataTable

I have a DataGridView, which I populate data for automatically, as per the following: MySqlDataAdapter adapter = new MySqlDataAdapter(query, connString); DataTable table = new DataTable(); table.Locale =…
Jack
  • 16,276
  • 55
  • 159
  • 284
3
votes
1 answer

C# The parameterized query X expects the parameter Y which was not supplied

I have some problems when trying to update values in my SQL Server database. I have the following DataGridView: I want to change the checkbox then write the boolean back to SQL Server when I hit the save button below. I added the BindingSource to…
JasonX2000
  • 35
  • 5
3
votes
2 answers

Replace specific value in all cells when selecting from SQL table to dgv

I use a Select query to fill a DataTable from an SQL table and then use that DataTable as a DataSource for my DataGridView. In my SQL table I have a column named 'status' that contains values between 1-3. When I display my dgv on my form I want…
Roi Snir
  • 411
  • 1
  • 4
  • 13
3
votes
2 answers

After changing DataSource, why does DataGridView show rows only after sorting?

I am trying to make a DataGridView control get populated from a DataTable, that itself gets filled with the results of a sql query on a Oracle database. This should happen after double-clicking the table name from a ListBox control. This works fine…
3
votes
0 answers

Why does components.Dispose() not call DataGridView.Dispose()?

Problem I encountered this error whenever components.dispose() is called in a windows form with DataGridView. The following exception occured in the DataGridView: System.IndexOutOfRangeException: Index 0 does not have a value. at…
John Evans Solachuk
  • 1,953
  • 5
  • 31
  • 67
3
votes
3 answers

How to fill datagridview grayed area using empty rows

I need to know how to fill empty rows in datagridview's rest of grayed area, after datagridview has bind the data. Anyone have a simple method for this please comment here.
Nishantha
  • 93
  • 1
  • 1
  • 10
3
votes
1 answer

Using a textbox entry to filter a datagridview with an int value? VS C#

I'm using a datagridview to display data, and this code to search/filter it using a text box. private void textBox1_TextChanged(object sender, EventArgs e) { try { BindingSource bs_sp = new BindingSource(); …
3
votes
1 answer

Using custom CheckBoxComboBox in DataGridView column

I need to use the combobox control with items that can be checked in the DataGridView column. So i have found one control from the following link https://github.com/sgissinger/CheckBoxComboBox/ In this the basic CheckBoxComboBox is working fine in…
Shubhit304
  • 181
  • 1
  • 15
3
votes
1 answer

add datagridviewcolumn property designtime

I have this problem, I created my own datagridviewcolumn and I wish add some properties that you can change in designtime editing... here is my code: private int nMaxLength; [Description("Fondoscala valore"), Category("Sea")] public int MaxLength { …
ghiboz
  • 7,863
  • 21
  • 85
  • 131
3
votes
1 answer

DataGridView - Index was out of range.

Before anyone classes this as a duplicate, I have indeed searched both around StackOverflow and the Google for the solution to my problem, neither have proven to be successful. To summarise: I am building a game as a part of a unit in my CS course…
Matt Kent
  • 1,145
  • 1
  • 11
  • 26
3
votes
2 answers

C# Check if DataGridView Contains specific word

I'm currently working on an IRC bot. The sent messages will be shown in a DataGridView. So now I want to check if for example the sent message contains a specific word. Let's say "test". So it should check for the following: Let's say the sent…
GERIskillzZz
  • 33
  • 1
  • 1
  • 4
3
votes
3 answers

Click event for specific cell in datagridview vb.net

I have a cell in a datagridview its located at the 8th row 2nd column That cell and that cell only if clicked I want to show as save as dialoguebox but I can actually get a click event happening for a specific cell how do I do this in vb.net?
TM80
  • 123
  • 2
  • 2
  • 12
3
votes
2 answers

How to bind Navigation Property (second level model's two properties) in DataGridView's single column using BindingSource?

I have faced problem to show the values in grid view using binding source. I have two models as Company and Partners. I have PartnerId in Company Model, and Partner model has FirstName and LastName. I have showed the company info and partner's…
3
votes
1 answer

Displaying Checked column Values in Datagridview checkbox showing data in another form Datagridview

I have one datagridview(dataGridView1 which contains a dataGridview2 column header) in which I have one checkboxcolumn, called dgvCkb, in dataGridView1. When I uncheck dgvCkb in any row the data of that row should not be shown in another…
dhana
  • 83
  • 1
  • 9
3
votes
1 answer

ComboBox.SelectedValue not working as expected

So I have a DataGridView which I am using as a “row selector” on a form, and a bunch of controls are bound to the bindingSource. One of the bound controls is a ComboBox serving as a lookup which enables status choices for the rows, this is…
1 2 3
99
100