Questions tagged [datagridviewrow]

Represents one row in DataGridView

Learn more about DataGridViewRow on MSDN.

110 questions
0
votes
1 answer

Not getting all rows when iterating through DataGridView rows

In a VB.NET WinForms application I have a DataGridView with a checkbox as a non-bound column in the first column. I need to add to a collection of rows each row that has its checkbox checked. I'm using the below code to iterate through the rows and…
marky
  • 4,878
  • 17
  • 59
  • 103
0
votes
1 answer

AddRowEvent in DataGridView Adding Extra Row

I have an unbounded DataGridView. I am trying to eliminate the extra row being added at the end. I have set the AllowUserToAddRows to false. // This code is adding two rows at the beginning this.dataGridView1.AllowUserToAddRows =…
user2970916
  • 1,146
  • 3
  • 15
  • 37
0
votes
1 answer

Crashing when trying to see if my Cell is checked or unchecked

My system clock is 9/16/2014 (Tuesday) But in code, I'm always jumping to Monday. DayOfWeek dow = DateTime.Now.DayOfWeek; int columnNumber = 0; columnNumber = columnNumber + 0; foreach ( DataGridViewRow row in dataGridView1.Rows ) { switch ( dow…
software is fun
  • 7,286
  • 18
  • 71
  • 129
0
votes
1 answer

Why am I crashing and getting the wrong day of the week?

My system clock is 9/16/2014 (Tuesday) But in code, I'm always jumping to Monday. DayOfWeek dow = new DateTime().DayOfWeek; int columnNumber = 0; columnNumber = columnNumber + 0; foreach ( DataGridViewRow row in dataGridView1.Rows ) { switch (…
software is fun
  • 7,286
  • 18
  • 71
  • 129
0
votes
1 answer

Setting a DataGridView source nullifies all existing DataGridViewRow objects

I've got a project with a DataGridView showing data from a flat file database. There are 7 buttons that load an SQL querys result to the DGV, as well as adding a checkbox to select rows. When a user selects a checkbox, that particular…
Phil
  • 167
  • 6
0
votes
1 answer

How do i remove a row that is not equal to "0"? I tried this but it removes only 2 or 3 rows

// the lup that goes through every row foreach (DataGridViewRow row in dataGridView1.Rows) { if (dataGridView1.Rows[0].Cells["Payment"].Value.ToString()!="0") { …
Tiamo
  • 1
  • 1
0
votes
1 answer

DataGridView Cell update

I'm working in vb.net and trying to update dgv to list a customers name instead of ID. I already have all the functions to get the customer name given the id, so that isn't much of an issue. My issue is that when I load the DataGridView, it will…
Chris Hobbs
  • 745
  • 2
  • 9
  • 27
0
votes
1 answer

Adding records (Row/ Column) to DataGridView; Collection already belongs to a DataGridView control VB.NET

I'm looking for some help with an issue I am having. I have multiple text files, in a folder. The folder can have an "unlimited" amount of text files in it, although typically 2-150 files http://gyazo.com/5f314d1ca374abf9f813914609dd931d (images…
0
votes
1 answer

How to find cells having same values in DataGridView?

I have DataGridView containing number of rows and columns, like ID, Name, Addr, etc. I want to find rows which have same value in the Name column. e.g. ID Name Addr ---------------------- 1 Pravin India 2 Shubham Nepal 3 …
Pravin Chopade
  • 77
  • 1
  • 14
0
votes
2 answers

Trying to delete entire row in datagridview if all cells in row have same value

I have a datagridview in which I populate via a loop and then use the cell painting went to make all cells that have te value " $0.00". What I'm trying to do now is after my populate loop executes I want to go through each row and if each cell…
CaffeinatedMike
  • 1,537
  • 2
  • 25
  • 57
0
votes
0 answers

Change the position where DataGridView rows are painted

I have a custom derivative of a DataGridView. I'm looking to change the positions where some rows will be drawn: starting from a certain index forward, I want to move each row below that row one row-height lower, so I can paint custom shapes in the…
John NoCookies
  • 1,041
  • 3
  • 17
  • 28
0
votes
1 answer

passing gridview data between 2 forms

how to tranfer Form1 checked GridView Rows Data on Form2 Gridview? Like This:
user2491383
  • 160
  • 2
  • 4
  • 13
0
votes
1 answer

Extend DataGridViewRow in C#

I want to extend DataGridViewRow to have two custom properties . I know I have to inherit from DataGridViewRow and add my custom properties . I will be appreciate if somebody show me the road map .
Amir
  • 352
  • 3
  • 10
0
votes
1 answer

How to solve error `You have specified an invalid column ordinal`

I am getting the following error: You have specified an invalid column ordinal I already checked the column number in my database and I know it's right. Here's my code: using (MySqlCommand cmd = new MySqlCommand(query, con)) { …
Harvey
  • 399
  • 4
  • 15
  • 31
0
votes
2 answers

Checking if a row has been selected entirely

My datagridview is in RowHeaderSelect mode. So clicking on the RowHeader selects the whole row. However, at any point, when i use context menu shortcuts or shortcut keys from the keyboard, i need to check if a whole row is currently selected, or…
Vivek
  • 255
  • 1
  • 5
  • 16