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

DataGridView CellFormatting performance issue

How to fix CellFormatting "slow scrolling" performance issue? Using this code to copy decrypted values from encrypted column to another column: private void grid_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if…
X11
  • 332
  • 4
  • 19
3
votes
2 answers

Custom Binding of multiple fileds in Custom DataGridViewColumn(WinForms)

I have a question regarding a data binding(of multiple properties) for custom DataGridViewColumn. Here is a schema of what controls that I have, and I need to make it bindable with DataGridView datasource. Any ideas or a link to an article…
Vera
  • 51
  • 2
  • 4
3
votes
2 answers

Exporting Datagridview to Excel in C#

This code always skips last row after exporting excel, can you check what's wrong in the code? I changed transcationTableDataGridView.Rows.Count - 1 to transcationTableDataGridView.Rows.Count + 1 it does export all rows to excel but throws index…
Patrick
  • 217
  • 1
  • 5
  • 19
3
votes
2 answers

C# Winforms DataGridView bold font style in rows

Why there is no text in rows? How to make text in rows bold? namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); …
A191919
  • 3,422
  • 7
  • 49
  • 93
3
votes
3 answers

DataGridView Auto Height - How to AutoSize DataGridView Height?

I am trying to make the height of my DataGridView AutoSize based on the amount of rows it contains. Currently, I was able to accomplish this with the following line: dataGridView_SearchResults.AutoSize = true; However this makes the Horizontal…
Reeggiie
  • 782
  • 7
  • 16
  • 36
3
votes
1 answer

Using DataTable at DataGridView to display small images(Icon)

[EDIT] I'd like to use image at Datagridview using DataTable. RadioButton is just a simple question format for this post. Let me clear myself for this. How can I add this "image" or that "image" on the datagridview using the binding style ?…
Jason
  • 361
  • 3
  • 15
3
votes
3 answers

Set the Backcolor of DataGridview Column Based on Editable Property

Im populating a Datagridview from Database by directly assigning the Data Table.There are some Columns in the Datagridview that are editable and some that are not.I want to set the color of the editable Columns to say 'Yellow'. I know that i can…
techno
  • 6,100
  • 16
  • 86
  • 192
3
votes
6 answers

Update DataGridView but do not select any rows when TabPage entered

I have a DataGridView on a secondary TabPage, and I would like the data inside the grid to update when the TabPage is entered, but I do not want the RowEnter event to be handled unless the user actually clicked on a row. It seems that the first row…
SSS
  • 4,807
  • 1
  • 23
  • 44
3
votes
0 answers

Bindingsource filter using DataGridView and Entity Framework

I'm developing my first Winforms app using Entity Framework to access database. I have experience using dataset and tableadapters. I have a form with a DataGridView (DGV) on it, and I want to filter the displayed data. In previous app, to filter…
Lucas Schorb
  • 31
  • 1
  • 5
3
votes
2 answers

Filter a DataGridView without losing unbound changes

Im developing a vb.net application and I have a dgv which displays a list of employees. The dgv has an unbound checkbox column which is used in selecting employees for a required action. I use rowFilter to filter the list by department or location…
Percy Kumah
  • 103
  • 10
3
votes
1 answer

C# Gridview first row of data not returning

I have a Gridview loaded from a database. The Gridview has BoundFields, Buttons, Textboxes, and Dropdown lists. If I select any row but the first row I am able to collect the data from that row. If I select the first row I can see the 0 being pasted…
MeGreeny
  • 49
  • 5
3
votes
2 answers

How to refresh the Datagridview when the Database has been restored from .bak without restarting the app using Vb.Net?

Important Edit I solved the problem. It was not a problem actually. What was happening is when I debug the program a new .mdf file creates in the debug folder from which my Datagridview and other objects in the application gets information. But…
3
votes
1 answer

How to add checkbox at specific row and column?

I want to add checkbox in a specific row and column but i'm always stumbled upon this error "System.FormatException: Formatted value of the cell has a wrong type." And here is my code to add the checkbox; private void checkboxSource(string…
MRu
  • 1,225
  • 7
  • 20
  • 44
3
votes
2 answers

Change the Value of Cell of DataGridView from other Form

I have 2 forms: Form1 contains DataGridView controls Form2 contains Textbox controls (are in mode read only), checkBox and Button. When I select a DataGridView Row it will show me Form2 and display their values in TextBoxes. Everything seems…
3
votes
1 answer

C# - How should i add datagridview combobox to datatable and preview it in datagridview?

Sorry if this is a silly question. I am quite new in this. How should i add combobox to datatable and then load it into the datagridview? Can this be done? And is this the best way? Tips and tutorials on how to do this are highly appreciated. Thank…
MRu
  • 1,225
  • 7
  • 20
  • 44