Skip to main content

Data binding & layout

The data-bound ticket screen from Module 4 · Data Binding & the DataGridView: a SplitContainer with a read-only DataGridView on the left and the ticket's details on the right. One BindingSource feeds both, so selecting a row fills the detail controls. Save Ticket goes through TicketService, then refreshes the grid on purpose.

Run it

cd "LearnWisej-Samples/Foundations Course/Module 4/WisejTrainingApp"
dotnet run -f net10.0 --urls http://localhost:5084

Then open http://localhost:5084. (Visual Studio: open WisejTrainingApp.slnx, press F5.)

What to try

ActionWhat you should see
Click a row in the gridTitle, Status, Priority and Created fill in on the right
Change the Status, click Save Ticketthe grid row shows the new status; the status bar reads Saved ticket #N

Where things live

FileWhat it's for
Models/Ticket.csThe shape of one ticket
Services/TicketService.csGetTickets() and SaveTicket() over an in-memory list
TicketsWindow.csLoadTickets(), the detail bindings, btnSaveTicket_Click
TicketsWindow.Designer.csThe layout: splitContainer1, dgvTickets, grpTicketDetails — generated by the Designer