Questions tagged [datagridview]

The DataGridView is a Windows Forms control found in the .NET Framework starting at version 2.0. It is used to display and edit tabular data from many different kinds of data sources.

0
votes
0answers
8 views

C# Automatic numbering Datagridview

Is it possible in datagridview with a bindingsource when adding a new row it's copy the last cell name and put a number to it? Copy the name is not a problem but the number after the name i can't get ...
0
votes
0answers
14 views

When attempting to save a empty cell into a datagridview it throws exception, how can i continue after it?

I am adding data to a dataset from a datagridview with this code: try { foreach (DataGridViewRow row in newitmStockGridView.Rows) { ...
0
votes
1answer
35 views

How to set Datagirdview row selected by textbox value C#?

I have a TextBox named txtvalue. Then I have a DataGridView with a column named Id. My problem is how to set the row of the DataGridView selected by value of txtvalue equal with column ID. The text in ...
1
vote
1answer
19 views

Vb.net datagridview last column set to read only

I know you can set a column of a datagridview to read only if you manually add the columns yourself, but Is it possible to populate a datagridview with mysql dB and set some colums to appear as ...
-1
votes
0answers
20 views

Get data from DataGridView only which is filled? [on hold]

I am stuck at getting data from DataGridView to Crystal Report in VB.Net. I want to get only those rows from DataGridView which are filled with result colomn. in the Left There is a List from I can ...
0
votes
1answer
28 views

what i write inside loop to display similar item code on datagridview and insert different itemcode on database sql server

Problem what i write inside loop to display similar item code on datagridview and insert different itemcode on database sql server . SQL Server Database(2014) Items Table ItemCode(pk) ...
0
votes
0answers
22 views

how to draw rectangle grid bar on Tablegrid based on Start time and endTime

I'm new to c#, WPF, Currently I'm able to draw a rectangle grid bar like this: using my WPF code: <Window x:Class="FunctionalFun.UI.MainWindow" xmlns="http://schemas.microsoft.com/...
-2
votes
1answer
50 views

How to make a loop to count rows in datagridView

I have a datagridView and DataTable. How to make a loop that add rows if it's not equal to 79 rows? If it's equal to 79 rows it will stop.
0
votes
1answer
45 views

C# If statement based on conditional Gridview cell color

Apologies if this is trivial, but I am trying to switch from VB to C#. I'm trying to change the background color of a Datagridview cell conditional on the background color of another cell. For example,...
0
votes
0answers
25 views

Center current cell view on datagridview c#

How can i center view on my selected current cell in datagridview? For example i have datagridview like this : for (int i = 0; i < 200; i++) { dataGridView1.Columns....
-1
votes
0answers
63 views

How to remove empty rows in one comlumn in dataGridView c#

I only have a one column in dataGridView. How to remove empty rows in my column? This is my Example ______ |Names | |----- | | Juan | | | |Pedro | |Juliet| |______| i have this code but it ...
1
vote
0answers
21 views

C# Bindingsource filtering

I've got a question about filtering of a bindingsource in C# (Visual Studio). I've got a large amount of rows with data which I'd like to filter on two columns, namely the city and the number of ...
-1
votes
1answer
22 views

customize datagridview column

I have a datagridview which is bound to a datatable containing 3 columns namely, CREAT, Type, RecordDate. I want datagridview to have two columns, one of the columns should be like CREAT (Type) and ...
-1
votes
1answer
10 views

Duplicate Rows (OBJECTS) after setting DGV Data Source [C#]

I am having a hard time solving this issue. I have an Object of called Section, I am adding this Section object to a list, then the list is used as the Data Grid View Data Source. When I add the ...
1
vote
2answers
31 views

Remove selected datagridview element from xml file

I have an xml file(data/tools.xml) created by C# program like this: <?xml version="1.0"?> <ArrayOfToolClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/...
0
votes
1answer
47 views

How to solve this problem in DataGridView?

I want the column header to be exactly compressed in the DataGridView.So I use this dgv_Layers.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill; But this happens And I don't want the ...
-4
votes
0answers
49 views

Remove all columns with no data from DataGridView c#

I have only one row. Now my question is If the column in dataGridView is empty, how to remove it from dataGridView and if it's not empty it will not remove? What's the most elegant way to do this ...
0
votes
1answer
39 views

How to create the zip file from the selected rows of datagridview in c#

I am displaying certain elements from .xml files into a DataGridView and it's working fine. Here is the code to select the xml files //Browse Folder private void Btn_SelectFolder_Click(object sender,...
-3
votes
0answers
12 views

using datagridview in user controls [closed]

I have created a user control with a datagridview. But when i use the user control in main application the user control says it is missing connection string? enter image description here
-1
votes
0answers
28 views

I need help to load a DataGridView

I'm trying to load the grid but it doesn`t load, the grid is empty. If someone tells me what the problem is in the code. Those methods are in the form with the grid Private Sub newStudent_Load(...
-3
votes
0answers
22 views

How to export datagridView to selected Columns and rows in excel file c# [on hold]

I have dataGridView which contains column["name"] and my excel file is already have a data. Now my question is how to update excel file and export my Column in datagridView to selected columns and ...
0
votes
0answers
30 views

How to compare the two columns of two DatagridView

I have 2 DatagridView and I have same column in datagridView1 and dataGridView2 now I want to compare each rows Column [ID] in datagridView 1 and 2, if that ID exist in 2 Columns, the Column["Names"] ...
1
vote
2answers
31 views

Why it always replace the first data when i click display?

I have a little problem with my system, This is my problem when i insert the data, that data will show in DatagridView, now if i insert different data again, the first data in the DatagridView will ...
-2
votes
0answers
11 views

how to export datagridview data to crystal report page

I have datagridview and just I need to show its content in my crystal report page when I click button how I can do, please . I create datagridview and printing button also I create crystal report ...
-2
votes
3answers
52 views

How to sum 2 columns within a row of datagridView

Hello guys? i'am working on Windows application form c# and I have 4 Columns in my datagridView, lets say i have 3 rows just like this ------------------------------- |Grade1|Grade2|Average|Remarks| |...
-1
votes
3answers
84 views

update insert data from bounded datagridview from datatable

I have bounded datagridview from datatable from sql server database I need to know how I can make update button that on click update edited data within this datagridview if there is new directly ...
0
votes
1answer
26 views

Searching for a string in DataGridView and keeping visible only the result

I have a search text box in a form that uses -match. A Write-Host shows a positive result when the search matches, but the DataGridView is hidden everything. I have tried 2 solutions but without ...
2
votes
0answers
54 views

C# Get deleted items and changed items to list

I have a question to get all deleted items to a new list and also for the changed items. I'm using a datagridview with a sortable bindingsource. For all new items it's already working(last part of the ...
-1
votes
1answer
26 views

Merging DataGridView cell in Winforms after adding a new row

I am creating a WinForms application in visual studio 2017, I have a dataGridView created with row data like the following: ----------------------------------------------------------- | V | ...
0
votes
0answers
13 views

Update LINE number of DatagridView row when insert or remove

In SQL table I have a column name _LINE_NO which is stored the sequence number of DatagridView row but it must start with 0. Now, I can update _LINE_NO when insert or remove rows but it starting with ...
0
votes
1answer
28 views

problem with fitting datagridview height according to the content

I have a datagridview whose styling is kept as follows dgvCreatinine.AutoGenerateColumns = False dgvCreatinine.AutoSize = False dgvCreatinine.AutoResizeRows() dgvCreatinine....
0
votes
1answer
25 views

Dynamic cell control in one column in WPF DataGrid

I want to create WPF DataGrid with dynamic cell control in one column based on value in another column as below image. XAML <Window.Resources> <Style x:Key="DataGridCellStyle1" ...
0
votes
2answers
44 views

Display cell value on textbox in c#

My problem is that it will only display the contents of datagrid on textboxes when i click on the cells under Price column which has a Money DataType all others except for ItemNo is Varchar(100). ...
0
votes
3answers
36 views

How to save DataGridView multiple row data in to MySQL database in c#

I have multiple row data in a single column. I need to save all data in to a MySQL DB. But it's only saving selected rows data only in DataGridView. Below is my sample code. private void ...
0
votes
0answers
9 views

How to make datagridview in c# column resizing with animation?

I have a datagridview with several columns in c#. I can easily resize them, However, it works without any animation. Now the resize works like this, I click between columns and move the mouse to the ...
0
votes
0answers
15 views

Get value of specific column while editing a Gridview when boundfield is set to false

How to get the value of some specific cell on editing a gridview when boundfield is set to false. <asp:GridView ID="GridViewInvoice" runat="server" ShowHeaderWhenEmpty="true" DataKeyNames="DOID" ...
1
vote
2answers
39 views

Format date in DataGridView column in custom format

I have a DataGridView where the user inserts data about different products. One of the columns holds data for the date when the item expires. I was told to make it as easy and fast for the user to ...
-1
votes
0answers
25 views

Is it possible to delete shape using the parameters in DataGridview?

I'm thinking about the logic and can't come up with something. What I want to do is that, I want the data in my datagridview: will be the "finding parameters" in my list of shapes. So it would be ...
-2
votes
0answers
31 views

Update value in datagridview from another form [duplicate]

I'm trying to update value in dataGridView from another Form. And I'm stuck and can't figure out how I'm suppose to solve it. In Mainview (Form1) I have the following code: public static int ...
0
votes
0answers
22 views

Using JSON to Populate Properties of a DataGridView

Recently, I have been dabbling in reading json data into my C# code with the intent of storing property data in the json file to be loaded at run time. For example, I'd like to make a json file for ...
0
votes
1answer
51 views

How do I use variable names as a column header for DataGridView when the variable name is only known during runtime?

Preface Not sure if it matters but I'll explain how my project is structured. It has three layers: native C++: Purpose is to read multiple files and perform calculations. The outputs are doubles ...
0
votes
1answer
17 views

How do i filter a table in another form from a selected row in the first form?

So i have 2 Forms. Both with DataGridViews. I want to take the ID from the selected row in the first form and filter the table in the second form so it only displays the data relevant to the selected ...
0
votes
0answers
29 views

Binding datagridview with data from LINQ query

I'd like to apologise in advance in case my question was answered before (also the problem is probably pretty basic too). I'm pretty new to programming and there's a good chance I fail to google for ...
-2
votes
0answers
10 views

suspend all bindingsources of a datatable

I have a datatable dtCustomers in my vb.net project and I have created DataRelationship of this table to many other datatables (nearly 20 other tables) inside a dataset 'dSet'. Each of those ...
0
votes
1answer
37 views

How to delete one row and update a certain cell in the rest?

What I want to do is if I click a delete button, the whole row will be deleted (e.g Row 1). And then, when it is deleted, the remaining rows will update it's "ID" prior to the value of the deleted row....
-2
votes
0answers
20 views

Is there any way to import data from excel to datagridview without using oledb or without installing access database engine in Vb.net?

Is there any way to import data from excel to datagridview without using oledb or without installing access database engine in Vb.net ??
0
votes
2answers
28 views

how to recognize newly added rows directly to datagridview - c#

I have bound a datatable to a datagridview and allowed the user to delete update, and insert new records directly to this datagridview Now I want to know how do I recognize newly inserted row/rows ? ...
0
votes
0answers
13 views

VB.NET Synchronize DataGridView (OnChange) with DataTable

Currently, when my form loads, a function on the background populates a DataGridView (with a DataTable as Source). Public Function ExceltoDataTable() As System.Data.DataTable Dim dataTable As New ...
0
votes
1answer
40 views

Copy values from datagridview to 2 dimension string C#

I have a two-dimensional variable that looks like this : string[] Dimension = new string[] { "+-----+", // -----> X /\Y "|XXXXX|", ...
0
votes
0answers
10 views

How to insert and update all the data of datagridView to sqlDBc#

i have 3 Columns which contains ID,NAME and Age.My question is How to save to SQL database all data that i inputted in dataGridView1 because i'am not using any textbox, for example i input 3 names and ...