Questions tagged [datagridviewrow]

Represents one row in DataGridView

Learn more about DataGridViewRow on MSDN.

110 questions
1
vote
1 answer

How to remove the last DataGridViewRow when inserting a new one at the beginning?

Using a Windows Forms application. I have this class, derived from a DataGridView control: public class CustomDataGridView : DataGridView { private int maxRowsAllowed = 3; public CustomDataGridView() { this.AutoGenerateColumns =…
Shin
  • 664
  • 2
  • 13
  • 30
1
vote
1 answer

Merge 2 rows from 2 separate datagridviewrows into a new one vb.net

I'm trying to merge two rows and write it to a new row on a third table: Example: TableA: (data is fixed) customer | name | last name 1 | bob | jansens 2 | jan | peeters ... | ... | ... TableB: (data is fixed) age …
krstfvndm
  • 143
  • 1
  • 7
1
vote
4 answers

how to count the total number of checked data grid view check boxes by rows not by columns

We are currently doing a student monitoring attendance , and we want to count the total number of days each student is present and absent . Subject LN FN MI 05/21/14 05/20/14 05/21/14 05/22/14 05/23/14 P A Comp101 Yu Erick C…
1
vote
1 answer

Force datagridview call row validating after finish input

I'm creating a Form with a Bound Datagridview inside it. On Form_Load or Row_Validating, I added new row to Datagridview by: Private Sub PurchaseInRowAdd() 'add new row to datagridview Dim dtRow As DataRow =…
Doan Cuong
  • 2,594
  • 4
  • 22
  • 39
1
vote
1 answer

GridViewRow not returning proper cells

So I have this problem with one of my pages, which basically lists out a bunch of comments for a specified student. The comments are supposed to be editable, but I'm having a problem with getting the contents of a row (so I can display the comment…
TheAJ
  • 10,485
  • 11
  • 38
  • 57
1
vote
1 answer

Transfer selected DataGridView row to a new DataGridView in another form

I have exhaustively researched (googled) a solution to this problem, but can find none. My problem is that upon selecting a row in Form1 (Called that for clarity) it does not transfer the values to the DataGridView in Form2. Mind you, all the column…
1
vote
2 answers

Get index of first row that matches with a pattern

I have a datagridview with some columns and rows. One of the columns is string type (DataGridViewTextBoxColumn). I would like to iterate over all the rows of this DataGridViewTextBoxColumn to find the index (row index) of the first element that…
Willy
  • 9,848
  • 22
  • 141
  • 284
1
vote
2 answers

Changing a datagridview row color at runtime

I'm inheriting the DataGridView control for a control I'm developing. My goal is to make each row color representing an object State that can change at runtime. My object implements the Observable design pattern. So I decided to develop my own…
Rifu
  • 93
  • 1
  • 2
  • 9
1
vote
1 answer

How can i get the value of the next row of my DataGridView

How can i get the value of the next row of my DataGridView in my FOREACH foreach (DataGridViewRow row in dataGridViewSelection.Rows) { if ((bool)((DataGridViewCheckBoxCell)row.Cells[3]).Value) { do { …
pharaon450
  • 493
  • 3
  • 9
  • 21
0
votes
1 answer

Querying Database - Best Practice

I have a number of database tables below. I want to display each user in a datagridview and their related 'Pass' field value. Current query is 1. Load all Users from User table 2. Users added to datagridview 3. Loop datagridview - for each user…
K09
  • 201
  • 2
  • 13
0
votes
1 answer

How to store the Datagridview cells value in to 2D array

I am developing a program in VB.net using datagridview. My datagridview column number is fixed. The number of rows will vary. After adding each row, I want to store the cell values in an array. How do I write code?   Or else, after adding all rows…
0
votes
1 answer

Error when trying to insert data from vb.net datagridview into SQL Server table

I get this error when I run the code. The records are inserted into the table, but the program stops at the error. The parameterized query '(@EmpName varchar(8000),@USDBasic varchar(8000),@OtherUSDEarning' expects the parameter '@EmpName', which…
0
votes
1 answer

Why is the DataGridViewRow.Cells[x].Value returns null while it is not null?

I know it seems a duplicate of this question, but I have something different to ask. I am working on a simple winforms project which connects with a local database file which has two tables. I am showing data from those tables in two different…
Nuwan Thisara
  • 226
  • 5
  • 15
0
votes
0 answers

Want to display message for particular rows with list item which column value is null or blank in datagridview

Dear All Master, I Want to display message for particular rows with list item column value is null or blank in datagridview. so I want to display the message from the list item of "column1" where the null and blank. Is there a recommended solution…
roy
  • 693
  • 2
  • 11
0
votes
0 answers

Issue with Index was out of range. Must be non-negative and less than the size of the collection

Please help me to solve this error as I tried in more than one way When I try to change in cell number 5, the error appears, but the error does not appear if I try to change in any other cell Private Sub Button1_Click(ByVal sender As System.Object,…
Arm Lion
  • 1
  • 1