Binding to DataGridView so each cell is a bound object rather than each row?

May as well have your MapGrid defined as public class MapGrid { public int ID { get; set; } public short PageNumber { get; set; } public char ColumnNumber { get; set; } public byte RowNumber { get; set; } public int RouteID { get; set; } public byte RouteNumber { get; set; } } You can then use simple binding as you desire.

The RouteSummary class is actually used elsewhere in the code. So it's good OO design to break it out. But, let's say I do go with a single class like you suggested.

How would that help me bind as I was describing? I don't follow. – Ecyrb Nov 30 '09 at 15:34 what's the relationship between your objects?

Is it a one to many between RouteNumber and MapGrid? It's unclear exactly how you want your output to look. I thought the problem was that you were having difficulty displaying the route number on each map grid row, because it was a property of a RouteSummary object field rather than a property of the MapGrid object.

– Adam Ralph Nov 30 '09 at 18:14 Yes, one Route can have many MapGrids. The output I'm shooting for is, for example, a DataGridView with columns A-F and rows 1-6 (a 6x6 grid, but these numbers are variable, which is what makes it difficult). I was hoping to set the DataGridView.

DataSource such that if a MapGrid has ColumnNumber = 'A' and RowNumber = 1 the corresponding cell in the DataGridView would display the MapGrid.Route.RouteNumber. Sorry for the delayed response, I didn't notice you replied until just now. – Ecyrb Dec 18 '09 at 16:21.

I came to the conclusion that what I wanted to do couldn't be done by using the DataGridView. DataSource property. In the end, I used for loops to manually add columns and rows to the DataGridView.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions