I've tried -
DataGridView1.DataSource=Nothing
and
DataGridView1.DataSource=Nothing
DataGridView1.Refresh()
and
DataGridView1.RefreshEdit()
None of them works..
I've written a method that sets the DataSource of the DataGridView when executed. but…
I new to C# and have a question regarding the use of "var"
When I use the following code everything works great
foreach(DataGridViewRow row in myGrid.Rows)
{
if (row.Cells[2].Value.ToString().Contains("51000"))
{
row.Cells[0].Value =…
In windows forms, I'm trying to fill a DataGridView manually by inserting DataGridViewRows to it, so my code looks like this:
DataGridViewRow row = new DataGridViewRow();
row.CreateCells(dgvArticles);
row.Cells[0].Value =…
I have a DataGridView in my WinForm application in C# 3.5.
AllowUserToAddNewRow property is set true. When user types any text in DataGridView, another new row is automatically added to DataGridView. I do not want this new row added until some…
I have a DataGridView on a TabPage. When the user clicks on a row, a second DGV appears. Each row is associated with its own DGV filled with data. What I want is for when the user goes from one row to another, the DataGridView changes too. So far…
I have a DataGridView with rows that I group based on group number. To visually separate the rows of different groups, I set the DividerHeight of the last row in a certain group.
I want to implement a different behaviour for mouse events for row…
I have some problem, don't now how to preserve the scroll position in a DataGridView.
I have over 1000+ rows and scrolling back to edited row is painful. How can I preserve the scroll position and scroll to the edited row after refreshing data?
In a Windows App (Visual Studio)(VB) how do you drag and drop a single row to another postition to allow for the user to re-order the row? I haven't found any worthy examples for this yet.
I am new to posting on Stack. I have searched for quite some time to a problem similar to mine. I am trying to change the checkboxes in a WinForms DataGridView from not read-only to read-only based on the object's boolean value dynamically.
It…
I'm using the following code to set a bunch of DataGridViewRow elements to be invisible. The rule I am using is to check the associated datasource for a boolean flag. If the flag is true, the row will be displayed. If not, it will be invisible.
The…
I am trying to get the DataGridViewRow with the max record id value.
I am able to get the record id itself but I need to find the row itself.
This is my code for getting the max record id and it works fine:
var addedRow =
…
I have a datagridview for which I have included couple of validations like cell value not empty and cell value should be in the range of (1,9). I also wanted to make sure a compute button is enabled only after the entire datagridview is filled with…
Is it possible to replace an entire DataGridViewRow value in one line of code?
Dim dgvR As DataGridViewRow = dgvExcelData.Rows(i)
'[...]
Dim row As String() = New String() {a,b,c,d,e}
I don't want to replace like this:
dgvR.Cells("xxx").Value = a
c# windows forms
i have a datagridview and two columns are present which are created at form design time.
i fetch the data from a table and want to add the data row-wise into the grid.
i could do it in two ways
1. for every row in the…
I have a dataGridView1, dataGridView2 and a ButtonAdd in one Form.
The user will:
1- select any one "Cell" or the "entire Row".
2-select multiple Rows
Then:
the data selected will be moved from dataGridView1 to dataGridView2 when the button clicked.…