hopefully provide some guidance on how to do this.
Mainly you can use a DataGridView Control (Windows Forms) to enter data row-wise.
The article have several links with guidance & details, go through them.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I would like to add a user input table to a windows form, I would like the user to be able to enter the number of rows required but restrict the maximum number of rows to 6.
The table would have 5 columns, (1 description entry & 4 numerical value entries) & the user can either select the number of rows required from a drop down list or enter the number in a textbox or something, but only be able to enter a maximum of 6 rows.
I would then like use the to numerical values entered to calculate various equations & create a chart.
I am not very experienced with coding but would appreciate it if anyone could tell me if this is possible & hopefully provide some guidance on how to do this.
Best Regards,
Sean
hopefully provide some guidance on how to do this.
Mainly you can use a DataGridView Control (Windows Forms) to enter data row-wise.
The article have several links with guidance & details, go through them.
Hello,
If you want to create a table-like structure in a Windows Forms application using C#, you can use the DataGridView control. The DataGridView control is a versatile control that allows you to display and edit data in tabular format. Here's a simple example to get you started:
Name
(e.g., dataGridView1) and adjust its size.using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WindowsFormsTableExample
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
// Call a method to populate the DataGridView with data
PopulateDataGridView();
}
private void PopulateDataGridView()
{
// Create a list of data (you can replace this with your data source)
List<Person> people = new List<Person>
{
new Person { Name = "John", Age = 25, City = "New York" },
new Person { Name = "Jane", Age = 30, City = "Los Angeles" },
new Person { Name = "Bob", Age = 22, City = "Chicago" }
};
// Bind the list to the DataGridView
dataGridView1.DataSource = people;
}
// Define a simple data model (replace this with your actual data model)
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
public string City { get; set; }
}
}
}