I have this class Relation, which is objects are populated in dropdown:
public class Relation{ public string City { get; set; } = default!; public int Kilometers { get; set; }}
public class Relation{ public string City { get; set; } = default!; public int Kilometers { get; set; }}
And this class Travle which should be DataSource of data grid view:
public class Travle{ public Relation {get; set; } = default!; public int Count { get; set; }}
public class Travle{ public Relation {get; set; } = default!; public int Count { get; set; }}
In picture you will see what I want to bind, so when I select Relation from first coulmn it should show Kilometers and when I enter Count it should create new object in DataSource.
Why this doesn't work when I have
dataGridViewTravles.DataSource = new List<Travle>();
dataGridViewTravles.DataSource = new List<Travle>();
I don't have option to add rows in data grid view?