Click here to Skip to main content
15,908,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello there,
I am new to WPF (I used to develop windows applications before), but i want to try to build an application using WPF, ADO.NET and C#.NET.
I am quite lost as i don;t know how should i represent a cinema seating chart in WPF. I have in mind to place inside a grid in a WPF form a set of buttons, each representing a seat in the cinema hall. Now i want to bind these buttons to fields in a Datatable and change the appearance of the button on button click, when the seat is to be tagged as sold, for example.
Should i be creating fields for each seat in sql table to be able to bind to a button in the WPF form? Or should i be creating a class for the seating chart and have a list for the seats and bind the list's elements to the buttons?
If somebody can help me i will be very glad. I did some research but could not find any code resembling what i intend to do.
Thanks in advance.
Posted

@YAROJAN77

Best way to implement is using the ListBox and overriding the ItemTemplate and ItemPanel.

I have a small sample here. Check that out, that might give you some insight. All the best.

https://sites.google.com/site/html5tutorials/DataGridCheckBoxSelection.zi[^]
 
Share this answer
 
Hello there,
Thanks a lot for your guidance.
Although I need to display the board (the map of the seats) and i cannot display it as grid as in your code.
There are other things that are beneficial to me in your code, however, so thanks a lotttt!!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900