Questions tagged [datagridviewrow]

Represents one row in DataGridView

Learn more about DataGridViewRow on MSDN.

110 questions
0
votes
0 answers

Passing a value to a field of deleted row in DataGridView

I have a DataGridView gvCategory bound to a DataTable MyDataSet.Category. When a user deletes a row or rows, I would like to pass the UserID of the person who deletes the row(s) along with the RowID (of course) to the stored procedure so I can keep…
T L
  • 504
  • 2
  • 11
  • 27
0
votes
1 answer

C#.NET foreach skips first row of DataGridView when changing Row HeaderCell value

I'm trying to show the row number on DataGridView RowHeader, but when I do the following block of code it doesn't change the first row row.HeaderCell.Value, but it will change all the next. When I watch the row variable and the gridView.Rows[0], the…
0
votes
1 answer

I Want to search Specific item from another datagridview to another datagridview and get the sum of the value

want to search items using datagridview 1 as my search Engine and search to datagridview2 and display the result to datagridview2 it must go like this Datagridview1 datagridview2
0
votes
1 answer

Programatically add a gridViewrow in c#

DataGridViewRow row = (DataGridViewRow)dataGridView1.Rows[0].Clone(); row.Cells[0].Value = "AbC"; row.Cells[1].Value = 123; dataGridView1.Rows.Add(row); Previously I used to add new rows using above code. But now It gives error Index was out of…
Abbas
  • 9
  • 6
0
votes
2 answers

C# Datagridview method Rows.Add works incorrectly - it add line on previous, not on last

I have a problem with datagridview.Rows.Add method. I want to add a new line but in the last line, not in previous. I don't know why the method Add doesn't work in this case. My code: dataGridView1.RowCount = 3; …
Nika
  • 379
  • 2
  • 16
0
votes
1 answer

C# DataGridViewRow - is new or updated row

I have DataGridView where I am showing data read from database: DataSet ds = new DataSet(); sqlDa.Fill(ds); dgView.DataSource = ds.Tables[0] After adding all of the rows in the UI, I need to to SQL UPDATE of rows that previously read from database,…
0
votes
1 answer

C# Winforms DataGridView selected cell is clearing cell value

I'm developing a booking system. I'm using multiple DGVs to visually display booked slots for different rooms based on 30 minute slot cells in a DGV, each room has its own DGV. I used a foreach statement on each room to create a new DGV, change the…
0
votes
1 answer

How can I make a cell to read only when it has been filled? DataGridView C#

I want to have a table displayed on a DataGridView with multiple columns, all of them on readonly but one. This one column needs to have the capacity of being filled by the user, but I want to make the cells that already have content on them…
Miguel V
  • 606
  • 2
  • 6
  • 18
0
votes
1 answer

Determine the type of a row in a DataGridView using a DataTable data source

I have been writing a small winforms program using the DataGridView control, using List<> as the data source. I used the following MouseClick event to show a specific context menu depending on the data being shown in the grid (there are three…
0
votes
1 answer

If DataRow exists in DataTable, update values within it

Each time a user changes a value in one of the editable columns within my DataGridView, it triggers a recalculation of up to 8 fields. This means the event CellValueChanged Event on the DataGridView will trigger more than 1 time. I want to create a…
Pawel
  • 141
  • 1
  • 10
0
votes
1 answer

How to fill Datagridview with Textboxes

I am quite new to programming and I am usually learning from courses on YouTube or directly tutorials from Youtube. My problem is I want to load file from CSV file and then update the loaded file into DataGridView. But to do so I was following a…
Dairy
  • 9
  • 4
0
votes
1 answer

NullReferenceException while adding row to DataGridView

I have matter on adding row to DataGridView in C#, I tried to add an String[] as DataGridView.Rows.Add argument but, always the same issue, now this is my final code, and It doesn't work again, always NullReferenceException: { …
0
votes
1 answer

Datagridview updating just last row

I have a folder in shared drive containing xml files. The file gets clubbed into a single data for live monitoring The FilesystemWatcher listen to last modified time and load the file in to main datatatable or merges it. The datagridview rowcell…
J D
  • 63
  • 1
  • 8
0
votes
1 answer

Can't use DataRow object for DataGridView current row, but can using the same code for another DGV

In a C# WinForms project I have two DGVs with similar functionality, just different data. For each, when the user changes the value of editable cells I'm using CellValueChanged to Change the color of the cell if what the user typed is different than…
marky
  • 4,878
  • 17
  • 59
  • 103
0
votes
1 answer

Update SQL Server database via a datagridview in C# on Visual Studio

When the user double click on a row on the datagridview, the relevant details appear in the textboxes. User can edit the details and click on Update button to save the updates on the SQL database. Note : CustomerID is an identity column in the…