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
1 answer

Datagridivew DataGridViewComboBoxColumn select value member

i have datagridview which has one combobox column. i populate combobox column. when i select any text from combobox column then i need to get the value when i read the data in for loop. dgFilter is here datagridview …
Thomas
  • 33,544
  • 126
  • 357
  • 626
3
votes
1 answer

Can the DataGridView header automatically resize itself?

Is there a feature in datagrids that will automatically resize itself (the headers) depending on the longest characters in its column? For example, if I have a long sentence, my datagrid header will automatically resize itself so that the message…
rj tubera
  • 747
  • 4
  • 29
  • 51
3
votes
2 answers

Delphi equivalent of C#'s DataGridView

Is there any real equivalent of C#'s DataGridView in Delphi? I have tried TStringGrid But the scrollbar is either invisible when all the items are visible, or it is the smallest scrollbar possible no matter how little the items are overflowed and…
Seth Carnegie
  • 73,875
  • 22
  • 181
  • 249
3
votes
1 answer

Select and Update DataTable in Windows Forms

XML 1 Artist 1 His album C://music//song.mp3 2 Artist 1
Andres
  • 2,013
  • 6
  • 42
  • 67
3
votes
2 answers

How to write a text file from a .NET DataGridView control cell values?

I have the following code that should loop through all the rows in my DataGridView, and write all their cell values to a text file. However, it outputs all the rows, but only the first cell of each one, and not the other three cells. string…
user826436
  • 231
  • 1
  • 4
  • 14
3
votes
2 answers

Database.open - 'The name 'database does not exist in the current context'

I followed the following tutorial to help me create a datagrid (http://www.asp.net/web-pages/videos/aspnet-razor-pages/displaying-data-in-a-grid), however, I keep getting the error in the title under the word database. I've tried replacing it with…
Blob
  • 541
  • 3
  • 20
  • 38
3
votes
2 answers

DataRelation Insert and ForeignKey

I have a winforms application with two DataGridViews displaying a master-detail relationship from my Person and Address tables. Person table has a PersonID field that is auto-incrementing primary key. Address has a PersonID field that is the FK. I…
Steve
  • 2,153
  • 4
  • 22
  • 31
3
votes
5 answers

Dynamicaly Setting font to a cell of DatagridView

In my winform am using DataGgridView In some scenario i want to set special font to some column and i achieve that using following code this.grvInvoice.Columns["mat_Name"].DefaultCellStyle.Font = new Font("Verdana", 14); But i want to set certain…
Nithesh Narayanan
  • 11,481
  • 34
  • 98
  • 138
3
votes
2 answers

How do you use a Custom Control for editing the contents of a cell in a DataGridView

I am trying to display a custom control in a datagridview cell so that I can show nicely formatted information. I am quite comfortable with the use of datagridview control accepting a list of objects as its datasource. I am also comfortable with…
KoolKabin
  • 17,157
  • 35
  • 107
  • 145
3
votes
3 answers

How do I make a DataGridView that doesn't snap its rows to the top of the control?

We've used the DataGridView extensively in our client. Our customers want to be able to enter large amounts of text into a row - too much to be displayed in the height of the DataGridView - and scroll through them using the main scrollbar - i.e.…
Simon
  • 25,468
  • 44
  • 152
  • 266
3
votes
1 answer

.net datagridview cell minimum width

I have a datagridview. I set AutoSizeColumnsMode property to Fill. However I want to set a minimum width for the columns. So, when too many columns are created, the scroll bar is shown. How can I do this?
user983924
  • 395
  • 2
  • 10
  • 23
3
votes
1 answer

DataGridView, Virtual Mode and "lags"

My code looks as follows: private void dataGridView4_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e) { Records recordsTmp = null; recordsTmp = (Records)this.ArrayOfRecords[e.RowIndex]; //ArrayList…
user1017258
  • 53
  • 2
  • 6
3
votes
2 answers

In C#, how do I make the left hand side border of the datagridview disappear?

I wanna make the left hand border of the datagridview object disappear. Any suggestions?
PixelatedPixie
  • 121
  • 3
  • 9
3
votes
3 answers

How to convert a DataGridViewCell to a Control

I am trying to convert a DataGridView cell to a control: Control dat = new Control(); dat = Convert.ChangeType(dataGridView1[colIndex,rowIndex], typeof(Control)); I am fetching the values of colIndex and rowIndes from a index code. The problem is…
Vincent
  • 484
  • 4
  • 6
  • 21
3
votes
5 answers

How to pass DataTable from one class to the other class

currently i'm studying MySQL, sorry for my newbie question. Here my question I have 2 class, the first one is Windows Form, and the other is just a class which I want contain all processes from SQL. here's my code in SQL Class public void…
Reza
  • 211
  • 6
  • 13