0

I have a Day Strucuture Table, which has following Columns I want to display:

DoW HoD Value
1   1   1
1   2   2
1   3   2
1   4   2
1   5   2
1   6   2
1   7   2
1   8   2
1   9   2
1   10  2
1   11  4
1   12  4
1   13  4
1   14  4
1   15  4
1   16  4
1   17  4
1   18  4
1   19  4
1   20  4
1   21  1
1   22  1
1   23  1
1   24  1

Dow is The Day of Week (Monday etc.), HoD is the Hour of Day and Value is the actual value.

Now I want to Bind this Day Structure Entity Collection directly to a Control so any Changes can be bound TwoWay

Like this Format: Matrix Example

I think the best way to achieve this is to use a Template and/or a converter, but I just dont know how ;)

I already read this article, but Lack of a TwoWay Binding functionality makes it not useful for me :(

I Hope you can help me

Jonny

Johannes Wanzek
  • 2,825
  • 2
  • 29
  • 47

1 Answers1

0

Again i solved it on my own ;)

For this problem i created a Grid with a fixed amout of rows and columns. Inside this Grid I put a Itemscontrol bound to my List of data. Inside the DataTemplate I placed a Textbox bound to the current value and bound the Grid Row and Columnproperties to the Day of the Week/Hour of Day.

Pro: The Textbox is TwoWay Databound to a certain Object or Element. Very Easy to implement if Row and Colum Property is numeric.

Con: Limited to a fixed amout of Rows/Columns. Very much Code to write in XAML (Copy and Paste) Kinda "dirty" Code. Feels not like the best way to do it.

Im still open for other suggestions.

Johannes Wanzek
  • 2,825
  • 2
  • 29
  • 47