Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

DataGridView set column cell Combobox

dataGridView1.AutoGenerateColumns = false;

DataTable dt = new DataTable();
dt.Columns.Add("Name", typeof(String));
dt.Columns.Add("Money", typeof(String));
dt.Rows.Add(new object[] { "Hi", 100 });
dt.Rows.Add(new object[] { "Ki", 30 });

DataGridViewComboBoxColumn money = new DataGridViewComboBoxColumn();
var list11 = new List<string>() { "10", "30", "80", "100" };
money.DataSource = list11;
money.HeaderText = "Money";
money.DataPropertyName = "Money";

DataGridViewTextBoxColumn name = new DataGridViewTextBoxColumn();
name.HeaderText = "Name";
name.DataPropertyName = "Name";

dataGridView1.DataSource = dt;
dataGridView1.Columns.AddRange(name, money);
Comment

PREVIOUS NEXT
Code Example
Csharp :: why does everything reset when switching scene unity 
Csharp :: Moq Unittest with ILogger 
Csharp :: C# varible 
Csharp :: atan2 speed unity 
Csharp :: jq map over array 
Csharp :: hide component in component menu 
Csharp :: Count Rows of table using Linq 
Csharp :: ef save changes 
Csharp :: txt.att.net not working 2021 
Csharp :: SceneManagment by BuildIndex 
Csharp :: c# linq sorting sequential guids 
Csharp :: c# fieldnullexception 
Csharp :: project camera view to texture 
Csharp :: validate preview input number wpf 
Csharp :: Set orientation of moving object towards it movement direction without using rigidbody 
Csharp :: C# dest 
Csharp :: .net objects 
Csharp :: is list sequential C# 
Csharp :: != in f# 
Csharp :: qget ViewSchedule revit api 
Csharp :: principalcontext c# example 
Csharp :: how do I write to a csv file from c# using entity framework 
Csharp :: paging thru result from mongodb in C# 
Csharp :: gegenstände bewegen c# 
Csharp :: Getting the ID of the element that fired an event 
Csharp :: c# printwindow 
Csharp :: function documentation c# exception 
Csharp :: unity set particle properties through script 
Csharp :: C# Bitwise Left Shift 
Csharp :: read barcode with barcode scanner c# winform serial port number 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =