3

I'm trying to mimic an access form where I have a subform embedded within a main form. The subform will be populated by a query based on the main form id. When the record changes the subform data will change. Is this possible to do in c#?

I tried looking for a data repeater but the only one I found was a VisualBasic.PowerPacks data repeater.

This is a very important app and the lead wants it to look and act just like the access app. I know that doesn't make sense but that is what he wants.

Any help pointing me in the right direction will be greatly appreciated.

Habib
  • 219,104
  • 29
  • 407
  • 436
Jerry Warra
  • 304
  • 1
  • 4
  • 20
  • WinForms? WPF? ASP.NET? – Ahmed KRAIEM Oct 02 '13 at 15:35
  • When you say sub form in the main form, do you mean Multiple Document Interface? http://en.wikipedia.org/wiki/Multiple_document_interface – Chris Spicer Oct 02 '13 at 15:36
  • I don't think MDI is what you are looking for. You can use the Visual Studio provided DataSource/form builder tools to have a form with details from a master record and a "subform" DatagridView that displays the detail records. – rheitzman Oct 02 '13 at 18:25

2 Answers2

2

What you are looking for is Multiple-Document Interface (MDI) Applications. With WinForm .Net framework provides MDI forms. You should see: How to: Create MDI Child Forms - MSDN.

You may also see: Introduction to MDI Forms with C# - Code project

Habib
  • 219,104
  • 29
  • 407
  • 436
  • Thank you all for your help. Sorry I forgot to mention it is a winforms application. I'm going to go through the links and figure it all out. Thank you – Jerry Warra Oct 02 '13 at 15:57
  • I was able to create a parent/child form using the links that were posted. How can I show data being repeated in the subform like in access? – Jerry Warra Oct 02 '13 at 16:08
  • Would using VisualBasic.PowerPacks.DataRepeater work in a "C#" app? Will I run into issues down the road? Sorry for all the questions. – Jerry Warra Oct 02 '13 at 16:36
  • @JerryWarra, don't create a C# app, you can create MDI forms in VB.Net as well. Its from the framework. – Habib Oct 02 '13 at 17:10
  • Habib thank you for your reply. I can't use VB.net. I'm using C# but i'm going to use the VisualBasic.PowerPacks.DataRepeater. I'm just trying to figure out how to get the combobox populated and then databind a value to it. – Jerry Warra Oct 03 '13 at 15:13
2

The old way was called MDI (Multiple document interface). You can still use this but with an external library (like WPFMDI).

The newer method is to use dockable windows, but you have to program them manually. See: Recommendations on a WPF Docking Library

Community
  • 1
  • 1
Michel Keijzers
  • 15,025
  • 28
  • 93
  • 119