Questions tagged [datagridviewrow]

Represents one row in DataGridView

Learn more about DataGridViewRow on MSDN.

110 questions
0
votes
0 answers

DataGridView: Set AutoSizeRowsMode only for certain rows

I am currently creating my own DataGridViewRow (called DataGridViewMultiRow), and I want to set only those rows in the DGV to auto-height that are not of the type of my new class. I have not found a good solution to this yet. My workaround is to…
Tobias Knauss
  • 3,361
  • 1
  • 21
  • 45
0
votes
1 answer

How to find DataGridViewRow in DataGridView that is "attached" to DataRow in DataTable?

In my example i have got: DataTable dt = SomeMethodThatFillsDataTable(); DataGridView dgv = new DataGridView; dgv.DataSource = dt; now I would like to "pick" some DataRows from DataTable and highlight it in DataGridView DataRow[] foundRows =…
Adam Filipek
  • 213
  • 1
  • 2
  • 5
0
votes
3 answers

Updating Datagridview when datasource changes

I have a Datagridview bound to a datatable. I'd like to hide or show a row depending on the value of a cell, for example if the cell value is "N" make the row visible else if it is "Y", hide the row. The datacolumn is setup as: New DataColumn With…
Nepaluz
  • 669
  • 1
  • 12
  • 27
0
votes
1 answer

How to delete only the data in the rows (prevent the rows to be deleted) in datagridview

I was trying to delete the data values in the row but it also removes the row in the DataGridView. code : spSumGrid.Sheets[0].Rows.Clear();//It deletes the Data & row in the table But I want to delete only the data in the row..
paramaguru
  • 7
  • 2
  • 6
0
votes
1 answer

Recover values and pass to a GridViewRow

I have a GridViewRow[] that has some data,this data is for example 4 rows that was selected from previous page (picture 1) After the checkbox marked,the user has to send to a confirmation page,in this page i need to generate another gridviewRow…
Vinicius Cano
  • 199
  • 1
  • 3
  • 18
0
votes
1 answer

Set value to button in datagridview

I set value to button in datagridview in formload by the code below: DataGridViewButtonColumn btnDelete = new DataGridViewButtonColumn(); btnDeleteText = "Delete"; btnDelete.HeaderText = "Delete"; …
0
votes
4 answers

Delete Top Row from DataGridView Without Clicking

I want to remove the first row from a datagridview before it loads in the form. What I have at the moment is : dataGridView1.Rows.Remove(dataGridViewRow[0]); This doesn't work. Can anyone tell me how I should adapt my code for this to work?
Josh
  • 115
  • 1
  • 3
  • 17
0
votes
1 answer

DataGridView is not showing first row after removing other rows

I am having a problem that I have been debugging for some days. Some context, I have an application where I store the data (in the following code a list of class Expediente) in xml files using serialization. For displaying the data I deserialize it…
0
votes
1 answer

Add DataGridViewComboBoxColumn to DataGridView, with different values in each row

Found many articles online, but to no avail for the solution I am looking for. My task: Add DataGridViewComboBoxColumn to datagridview, but each row should have different values in it's respective combobox. This is my code,…
scorpion35
  • 944
  • 2
  • 12
  • 30
0
votes
1 answer

setting the selected row programmatically for a DataGridRow (not by using the index!)

I have a form with a DataGridView on it, that gets populated in the form's Constructor from a DataSource using a data adapter (AdsDataAdapter). It shows people's first name, surname and reference number (which is the primary key of the underlying…
0
votes
1 answer

DataGridViewRow Wrong Cell Index

i've got a problem while trying to get some values through the DataGridViewRow. the problem is my cell index is 7 and when i try to get the data from the cell using this code: foreach (DataGridViewRow r in this.mydatagrid.Rows) { …
redcode
  • 1
  • 1
0
votes
1 answer

Datagridview add row with cell style programmatically

dgvStatus is a DataGridView with one column. Following line is adding new row dgvStatus.Rows.Add("XYZ"); But I want to change cell text color so I have written following code DataGridViewRow row = new DataGridViewRow(); DataGridViewCellStyle style…
MD SHAHIDUL ISLAM
  • 14,325
  • 6
  • 82
  • 89
0
votes
1 answer

VB.NET For Each Loop exits prematurely / Code returns to caller before finishing

I have two forms: Editor Tables On the "Editor" form I have a "KeyDown" event which opens the "Tables" form when the F5 key is down. Private Sub DataGridView_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles…
user3528004
0
votes
1 answer

Counting Services on multiple servers

I'm still a beginner with powershell, but love to learn and research all the things it can do. So with that, I am looking to create a script that will output to a datagridview table. I created a simple enough form that has a multi-line text box…
0
votes
3 answers

Check if New Rows Added to DataGridView and if so, Get the Collection of New Rows

In a VB.NET WinForms project I have a datagridview populated by a dataset. When the user clicks a button I need to check if there are any new rows in the DGV and if so, get the collection of rows for insert into the database. (I have the DGV…
marky
  • 4,878
  • 17
  • 59
  • 103