Questions tagged [datagridview]
DataGridView is a Windows Forms control used to display and edit tabular data.
19,990
questions
-1
votes
0
answers
47
views
C# pass searched value of datagridview1 to datagridview2
I want to pass the checked row from the first datagridview (DGVsearchRX) to the second datagridview (DGVorderRX).
I manage to pass the value to DGVorderRX if search by all in the DGVsearchRX.
For ...
1
vote
1
answer
29
views
underlying datatable doesn't get the row from datagridview
Now, this one can be very obvious for someone, but I am stuck right on this:
Datagridview is bound to a binding source and the binding source is bound to a datatable.
Datagridview is now showing an ...
0
votes
0
answers
27
views
Can't add rows to a datagridview which is connected to a BindingList
I have a weird issue IMHO, probably some guru's here would say it is completely obvious this doesn't work.
I have a form which creates a so called ClientProfile and this is stored in a XML file. I am ...
-2
votes
0
answers
30
views
How to add click event to e.Graphics.DrawImage
Here is my code:
private void dataGrid_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
{
if (e.RowIndex < 0)
return;
if (e.ColumnIndex == 3)
{
e.Paint(...
0
votes
0
answers
19
views
DevExpress Gridview Rating Control to display custom value
So I need to use RepositoryItemRatingControl to use in GridView
However, the column cell value that use RatingControl are floating and real time bound to a timer which constantly read from constantly ...
-4
votes
0
answers
28
views
Why the exclamation mark on data in datagridview of my VB application
I just created an application in Visual Basic using access as a database.
I had a datagridview in it and I programmed buttons to add data to the datagridview, delete as well as move up and down the ...
-1
votes
2
answers
65
views
Checkbox column not getting checked in datagridview c#
I have added checkbox column in datagridview and i want that checkboxes checked if one of my column value == 1 otherwise the checkbox should be unchecked
i have written following code where content ...
0
votes
1
answer
40
views
Export DataGridView into Excel using EPPlus Error property 'item' is 'read only'
i want to ask about Exporting datagridview into excel using EPPlus VB.NET.
i using microsoft.interop before this to export datagridview into excel and its work after several month i can't use ...
0
votes
1
answer
41
views
Create an Excel File from a dataGridView
I have a dataGridView in a WindowsForms. I want a button to export this dataGridView to an Excel Worksheet.
using Excel = Microsoft.Office.Interop.Excel;
Excel.Application ExcelApp;
Excel.Workbook ...
-2
votes
0
answers
54
views
I cannot sort numeric value in datagridview C# [closed]
I had a question - in C# I use ado to take the contents of tables from the database and drop them into the datagridview - when I click on the headers to Ascending or Descending in columns whose type ...
-2
votes
0
answers
26
views
from datagridview text column to image column
enter image description here
I want to move link column and assign it to colimage column. i don't know how to do it
0
votes
0
answers
26
views
How to add image to datagridview from IO.File.ReadAllLines(OpenFileDialog1.FileName)
Dim row(1) As String
Dim ColImage As New DataGridViewImageColumn
Dim image As New DataGridViewImageCell
For i As Integer = 0 To Lines.Length - 1
Dim line As String = Lines(i).ToString.Trim
...
0
votes
0
answers
30
views
Programatically add a gridViewrow in c#
DataGridViewRow row = (DataGridViewRow)dataGridView1.Rows[0].Clone();
row.Cells[0].Value = "AbC";
row.Cells[1].Value = 123;
dataGridView1.Rows.Add(row);
Previously I used to add new rows ...
0
votes
0
answers
45
views
How to access DataGridView from another Winform and show its data in TextBox
I have 2 Forms, both forms have separate datagridview. In form 1 I have a data entry form where multiple text fields are there. In Form1, I want Doctor textfield to get data as I enter from ...
0
votes
0
answers
26
views
How to add picturebox controls to datagridview in c#
private void InitializeComponent()
{
dataGrid = new DataGridView();
dataGrid.DataSource = this._lstWorklet;
dataGrid.DataBindingComplete += new System.Windows.Forms....
0
votes
1
answer
37
views
How to export csv from datagridview only visible column in VB.Net?
I'm working on scraping program, the next step from my program after scraping item is generate/export from datagridview into csv file. I have made the save code like below, but i just want to export ...
0
votes
0
answers
18
views
how to set dynamic size of datagridview in c#
I have dynamic set of records and I want to resize the DataGridView according to that.
For e.g.
and in the second image there are only two records.
0
votes
0
answers
76
views
Anchored DataGridViews not expanding as expected on installation on other computers
I'm working on an C# WinForms App in Visual Studio 2022.
Part of the application is a user control that has several nested SplitContainers which in turn contain either a DataGridView that is docked to ...
-1
votes
1
answer
28
views
is there any suggestions on add rows and columns in datagridview in vb
This is may code so far
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles
Button1.Click
Dim tab As Integer = TextBox1.Text
Dim row As Integer = TextBox2.Text
Dim i, j As ...
0
votes
0
answers
47
views
How to display sub DataGridView on Cell Click
Hello All I work with cashier screen for Selling I want as the picture below. How to display sub DataGridView on Cell Click to choose an item
Please help me
0
votes
3
answers
89
views
WinForms DateTimePicker to Selected Cell from DataGridView
I am new to WinForms and am trying to make an application that will hold certain data in a DataGridView Style.
Now I've managed to create the app where if clicked on a cell the TextBoxes and the ...
0
votes
0
answers
15
views
How do I link a chart item to a datagridview in VB.net?
I am trying to get my chart to display a column graph which gets the data from a datagridview, which is connected to an xml. I am not sure what to do exactly because there is nothing that is working.
...
0
votes
0
answers
48
views
Wrap text to new line in DataGridview cell
Good afternoon!
The DataGridView column has the following text:
Title (Dep)
programmer (IT infrastcomcture)
programmer (IT infrastcomcture)
System Administrator(IT infrastcomcture)
programmer (IT ...
0
votes
1
answer
70
views
DataGridView Cell Click( The data has a null value. Cannot caDataGridView CellClickll method or property on null values.)
I connected the textboxes to the datagridview on cell click, in order to modify from the textboxes, a column (8) is empty, even if in the SQL Server table I set it to allow null value, in the visual ...
-1
votes
1
answer
29
views
Linked DataGridViews Not Updating
I have 2 pairs of Master-Details (dgvs) datagridviews that are linked together. I also use binding sources for each table. See image.
Table Relationships
When I click on a row for the ...
-1
votes
0
answers
23
views
how to "automatic" checked checkboxcolumn based on status in datagridview in vb.net using for loop
how to "automatic" checked checkboxcolumn based on status in datagridview in vb.net using for loop
-1
votes
1
answer
44
views
Bulk update mysql table and calculate value from datagridview. VB.NET
I want to do bulk update my database table using value from datagridview, but also I need to sum the datagridview and mysql table value fisrt.
how do I do that?
here is my current code of my update ...
-1
votes
1
answer
65
views
How to allow only numbers in specific cell while editing using Winform
private void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
{
e.Control.KeyPress -= new KeyPressEventHandler(...
1
vote
0
answers
45
views
Custom class. Datagridview column text with image
Good afternoon!
There is a custom class that adds a text column with an image to the DataGridView.
Public Class DataGridViewTextAndImageColumn
Inherits DataGridViewTextBoxColumn
Private ...
0
votes
0
answers
38
views
DataGridView: custom cells destroyed when inserting/deleting/sorting rows
I have a grid where I need to use different cell types in the same column, based on the value of a field in the row.
This is a simplified version of the code I use to obtain these custom cells:
/* ... ...
-2
votes
1
answer
47
views
C# WinForm DataGridView Adding Unbound Column Breaks CellFormatting
I have several DataGridViews that use the CellFormatting event handler to convert database ID values into user-friendly display strings. However, one of these DataGridViews has an added ...
-1
votes
0
answers
36
views
How to add a new item to my liar object with nested props
I have gotten further with this than I thought I was able to on my own, but now I am stuck for sure. I have a .JSON file with nested properties. Under normal circumstances the only time this file is ...
1
vote
1
answer
23
views
BindingList to DataGridView, but get empty cells
I'm trying to place BindingList data into a default DataGridView, but without success. If I run the Form, it shows a DataGridView with empty rows. So the number of rows is correct, but the data itself ...
-1
votes
1
answer
46
views
How to update datagridview in C# after adding record nayf button?
It's my code button load on datagridview data with my database in SQL Server. After a click on the button, I want to update data in the datagridview. How can I do this?
public void load_data_Click(...
0
votes
1
answer
66
views
How to add a uncommitted blank row in Datagridview?
I am working to fill datagridview manually. So there is no datasource or databindings.
I kept AllowUserToAddRows to True and AllowUserToDeleteRows to True
MY WORK AND CODE
I tweaked to work my ...
0
votes
2
answers
81
views
Problem in databinding Array data to DataGridView in c#
I have been binding short data to DataGridView in C# Winforms. However, I need to bind long string array with size 75 to DataGridView. My data list class consists of 6 individual variables with get ...
0
votes
2
answers
73
views
Why dataGridView.Rows.Clear() doesn't work?
I have a WinForms application with a DataGridView set with default settings to allow users to add rows. But I want to remove rows programmatically as well.
When I run the function dataGridView.Rows....
0
votes
1
answer
46
views
Datagridview in C# is not retrieving all the records from SQL server database
I have a visual studio project for our student records and the records are coming from our online registration app. Then the database saves it. But the problem is my datagridview is not retrieving all ...
0
votes
0
answers
28
views
how to get datagridview.rows().columns().style.backcolor to work in cellvalidating?
I have a datagridview in which I paint in green the cell on entering and in white while endediting. I need to change the color of the cell to red if an error is trapped in cell validating. The last ...
2
votes
0
answers
71
views
C# WinForm DataGridView::CellPainting() calls to DrawString() sometimes results in text that is fainter than it should be
I have several DataGridViews that use Graphics.DrawString() in the CellPainting() event handler to display custom values in specific columns. Normally, these values display just fine and the text ...
0
votes
1
answer
55
views
C# GUI WinFormsApp textbox and trackbar values not saving or updating
so I am new to C# and am trying to create a really basic GUI on Visual Studio using WinFormsApp and the Designer.
Basically in my GUI there is a textbox that asks for a movie title and then a trackbar ...
0
votes
1
answer
37
views
Powershell Datagridview: avoid selection of rows based on a value in cell
I have a script that shows cells with various values. If a cell has the value '0' then it should not be possible to select the entire row.
Here, the rows with the numbers 10, 11 and 13 should not be ...
0
votes
1
answer
44
views
How to compare data from 2 DATAGRIDVIEW cells?
I have 2 DATAGRIDVIEWS and I need to insert the data in case of cell 3 value in datagridview 1 not equal cell 3 value in datagridview 2
This is the code of save button :
private void btnSave_Click(...
0
votes
3
answers
54
views
Sum DataGridView c#
I would like to show into a label the resul of the sum of all cells of one column. I tried one code that I saw in the net but the code doesnt work.
Here's the code:
foreach (DataGridViewRow row in ...
0
votes
2
answers
109
views
How to bind Access database to DataTable?
I'm new to C# and Visual Studio.
I'm working on a project that is searching through a database of information.
I want to bind a database (Microsoft access file) to my datagridview
but I want it to ...
-2
votes
0
answers
19
views
refresh datagridview in c++cli/clr windows form
After a lot of research i still don't know well how we really refresh a datagridview, i already modified things in with other command in my programme.
I just want want a button when clicked it refresh ...
-1
votes
0
answers
57
views
Multi Line Header in DataGridView C#
I am trying to get the 2 line header in DataGridView C# as shown below:
I am new to C#. I used to be in Delphi and the way I am doing this is Delphi is simply put "|" like Qty Supply | 15 ...
0
votes
1
answer
45
views
DataGridView show null decimal value
I'm programming an app in C# and I would like to show the data from the textboxes in the dgv. However, when I enter the value through the cart button, the value appears at 0 (as shown in the image ...
0
votes
0
answers
15
views
Scrolling while dragging on custom control in TableLayoutPanel in .net
I developed a user custom control that contained some Header Labels and a DatagridView:
This custom control is added to a TableLayoutPanel:
What I want to do is drag and drop data from one ...
-1
votes
1
answer
40
views
С# DataGridView how to display cell value by a known value in a string
In my DataGridView I have 3 columns: Bank, DataBuy, and DataSell.
I found Max and Min values using this code:
double[] columnDataBuy = (
from DataGridViewRow row
in DataGridView1.Rows
...