I'm trying to Insert all Rows values of DataGrid for Once every Click of a button, so if user inserted three times display on datagrid three rows, I have a class there is code
public string Name { get; set; }
public string Job { get; set; }
public string Phone { get; set; }
public MyGrid(string Vendors,string Jobs,string Tel)
{
Name = Vendors;
Job = Jobs;
Phone = Tel;
}
And I called into button click event here
static List<MyGrid> gride;
gride = new List<MyGrid>();
for (int i = 0; i < 3; i++)
{
var myg1 = new MyGrid(textBox10.Text, textBox11.Text, textBox12.Text);
gride.Add(myg1);
}
dataGridView1.ItemsSource = gride;
This code it's working but there is the one problem. When add data is supposed to appear in a one row, but appears within 3 rows in the one click, I want to show one row in per click with different data . How I can add new row per click on the button in WFP?