//Array를 Object로 변환해서, 한번에 Row에 출력하기.혹은 저장하기
/*
string n = "1234";
Method.1
int outValue = Convert.ToInt32(n);
Method.2
int outValue = int.Parse(n);
Method.3
int outValue;
int.TryParse(n, out outValue);
*/
class Program
{
static void Main(string[] args)
{
Application.Run(new NMNM());
}
}
public class NMNM : Form
{
private DataGridView control_datagridview;
public NMNM()
{
DESIGN();
DATA();
}
void DESIGN()
{
control_datagridview = new DataGridView();
control_datagridview.Dock = DockStyle.Fill;
control_datagridview.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
control_datagridview.MultiSelect = false;
control_datagridview.Location = new Point(362, 150);
control_datagridview.Name = "control_datagridview";
control_datagridview.Size = new Size(240, 150);
}
void DATA()
{
List<string> AuthorList = new List<string>();
AuthorList.Add("Mahesh Chand");
AuthorList.Add("Praveen Kumar");
AuthorList.Add("Raj Kumar");
AuthorList.Add("Nipun Tomar");
AuthorList.Add("Dinesh Beniwal");
control_datagridview.Rows.AddItem(AuthorList.ToArray());
}
}
'c# 언어 > 초급과정' 카테고리의 다른 글
공백여러개를 하나로 정리하기 (0) | 2023.12.13 |
---|---|
중도금이자::DateTime.ParseExact(manualDT, "yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture); (0) | 2023.11.21 |
now = DateTime.ParseExact(manualDT, "yyyyMMddHHmmss", System.Globalization.CultureInfo.InvariantCulture); (0) | 2023.09.06 |
람다식 문법 : (입력 파라미터) => { 실행문장 블럭 }; (0) | 2023.06.12 |
public int CompareTo (Version? value); (0) | 2023.06.09 |