thoughts on how to create a continuous form?

I want to create a continous form in my C# (VS2008) application -- the
same as a continous form in MS Access.  The purpose is purely for
exercise.  Here is the scenario:

Say I have a table with 50 rows.  I want to display the data from each
row in textboxes on a form.  Ideally, I could have a simple form with
the desired textboxes and a prev/next button setup to display the data
in each row.  But instead I want a continous form, and I am thinking
like having a panel for each row where each panel would contain the
desired textboxes for each row.  And these panels would be contained
within a larger panel (the parent panel) which would have a vertical
(and horizontal) scroll bar so I can scroll up and down the form to view
each row (each panel).  

A question follows, but Here is what I am currently thinking to achieve
my continuous form:  suppose the underlying table contains 30 rows of
data.  So in the form (call it formA) I dynamically create 30 panels
with the desired textboxes (I dynamically add textbox controls to each
panel and add each panel control to the Parent Panel) and populate
everything.  Then, if I refresh the data and say now there are 50 rows
-- I dynamically re-Add 50 panels and so on.  Say Panel1 is the parent
and I add controls to it (the panels containing the textboxes for each
row).  My question is if this is the approach I want to take?  If this
is not the ideal approach -- could someone suggest how I should do this?

Thanks

Rich

*** Sent via Developersdex http://www.developersdex.com ***
0
Rich
1/22/2010 5:13:34 PM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

1 Replies
1337 Views

Similar Articles

[PageSpeed] 51

Rich P wrote:
> I want to create a continous form in my C# (VS2008) application -- the
> same as a continous form in MS Access.  The purpose is purely for
> exercise.  Here is the scenario:
> 
> Say I have a table with 50 rows.  I want to display the data from each
> row in textboxes on a form.   [...]
>
> [...]  Then, if I refresh the data and say now there are 50 rows
> -- I dynamically re-Add 50 panels and so on.  Say Panel1 is the parent
> and I add controls to it (the panels containing the textboxes for each
> row).  My question is if this is the approach I want to take?  If this
> is not the ideal approach -- could someone suggest how I should do this?

Why not just use the GridView class?  It's specifically designed for 
exactly this kind of use.  You can even use binding to have it directly 
connected to your database.

Barring that, the next-most-appropriate approach IMHO would be to use 
the FlowLayoutPanel.  It's basically a panel with cells, which you can 
configure for a specific row- or column-major layout along with specific 
width and/or height.  You can then fill it with TextBox instances as 
needed, and it will automatically grow to contain what you want.

You can, of course, do everything yourself.  In that case, you probably 
want a single UserControl you've designed for convenience that contains 
the layout for a single row.  Then you can add instances of that 
UserControl dynamically as children of a Panel instance, setting the 
location of each according to the row index for that UserControl instance.

But really, I would just use GridView.

Pete
0
Peter
1/22/2010 5:51:59 PM
Reply:

Similar Artilces:

Autofill In Linked Forms
I have created a couple of forms by selecting all the fileds in the form wizard from two tables: 1. Suppliers (Fields: Supplier, Address, Contact, etc.) 2. Products (Fields: Supplier <Lookedup from Supplier Table>, Product, Rate, etc.) Upon clicking the toggle button on Suppliers form I have the Products form opened. However, as I enter the data in it, I want the Supplier filed in the same be automatically be filled with the Supplier name as in the opened Supplier form so as to be filtered and displayed the next time I open the same instead of manually inserting the sa...

Can see form in design view but not in open or layout view
I have set up the tables, relationships and forms. When I first created the form I was able to view when clicking open. I made a couple of changes and now when I click on open a box pops up to enter perimeter value. Also, I can no longer see the form in opne or layout but if I click for design view, I can see my form and all the tabs. There is either something missing or somthing is named incorrectly. Had a similar problem recently where a new version was installed in the front end, but the table in the back end had not been updated properly (a new field) and the new version of the...

create a boot disk when I have no floppy drive?
I have the XP Upgrade CD. How do I create a boot disk when I have no floppy drive? Thanks for any help. "Bob Tyrka" <rtyrka@cavtel.net> wrote in message news:PPedndBCv5CT7ZjWnZ2dnUVZ_gqdnZ2d@cavtel.net... > I have the XP Upgrade CD. How do I create a boot disk when I have no > floppy drive? > > Thanks for any help. > What do you need a floppy for? The XP CD is bootable in it's own right... "Bob Tyrka" wrote: > I have the XP Upgrade CD. How do I create a boot disk when I have no floppy > drive? > ...

Create Expression from Func? (3.5 SP1)
Hello: Is there are way to create an Expression from a Func? I don't like cluttering up my method signatures with the whole Expression<Func<TResult, T>> type. I would prefer for callers to simply see Func<TResult, T> instead. I'd like to take a Func and create an Expression from it. Is that possible? Thanks, Travis Parks Jehu Galeahsa wrote: > Hello: > > Is there are way to create an Expression from a Func? I don't like > cluttering up my method signatures with the whole > Expression<Func<TResult, T>> type. I would ...

Name Range with using Data Form
I first created a variable with A1:D1, four columns with named variable Data. How to expand this Data range to A1:D2 after using the DataForm to add one row data in the worksheet?? The same, the Data range should be A1:D3 when adding one more data row... million thanks Hi use the following formula in the name definition dialog =OFFSET($A$1:$D$1,0,0,COUNTA($A:$A)) >-----Original Message----- >I first created a variable with A1:D1, four columns with named variable >Data. How to expand this Data range to A1:D2 after using the DataForm to add >one row data in the worksheet?? The...

Create Process
if i call fork() / CreateProcess what is/are duplicated? i know that data space is duplicated for sure how about code space? the code space can be shared to save space.... but the new process may need to do rebasing... so...does the code space also shared? thx Action wrote: >if i call fork() / CreateProcess >what is/are duplicated? >i know that data space is duplicated for sure >how about code space? >the code space can be shared to save space.... >but the new process may need to do rebasing... >so...does the code space also shared? There is no fork in Windows. Creat...

Subtracting value from main form
I have a borrow module which will alow user to return item separately. So, I have get the structure of returning it separately. In my main form is the borrowing item, with the loaned quantity and the owed quantity (will be calculated). In the subform, there is the returning transaction. User will need to key in the quantity returned and it will be automatically deducted from the quantity owed. But how am I supposed to get the quantity deducted while it 1 is in main form and the other is in subform? -- Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-fo...

HOWTO create a Mail Merge Template in MSCRM with multiple child records
Hi, I have created successfully a basic Mail Merge template in MS Word in Dynamics CRM 4.0 for Order Entity. My challenge now is how to design a template that retrieves the order details (product and prices) related to the order record? This sounds like a parent-child template. Any idea? On Jun 2, 1:26=A0pm, "Benjie Fallar III" <bfall...@hotmail.com> wrote: > Hi, > I have created successfully a basic Mail Merge template in MS Word in > Dynamics CRM 4.0 for Order Entity. > My challenge now is how to design a template that retrieves the order > details (prod...

Creating a CFormView application produces errors
Using Visual Studio.Net 2003 I have created a C++ MFC application with Single Document Interface and Document/View support, and have changed the base class for the derived View class to CFormView. All other settings are their defaults. When I compile the source code generated, I get an error stating that the base class CRichEditCntrItem is undefined in the declaration of the CRichEditCntrItem derived class. According to the Help, CRichEditCntrItem requires the header afxrich.h If I add this include into the stdafx.H file and recompile, I get a syntax error in the constructor for the CRic...

Looking for a quick way to create a bunch of labels for annual mailing to diverse contacts
Using Office 2004 (11.2), I have numerous contacts that are part of diverse categories (some have not been categorized yet) I would like to create mailing labels for the annual calendar mailing. As of now I figured out how to select a large number of contacts & mark them as part of the annual card category (Command & click) and go to Word's Data Merge Manager where select the main document & then the address book as a data source. I went to Query Options and selected the category that fits (annual card). Now what? ...

Keeping forms in order they are entered?
I am working with a database that was designed for us and have pretty much just used without having to change much in but have now run into a problem and hope someone can help. We track and number complaints we recieve by number using last digits of year recieved then next number, i.e. a complaint recived 12/31/09 might be 9234 and first one received this year would be 10001 and the next would be 10002. The problem is now when I open my forms and go to the last one it is the 9234 instead of the 10002 which I need. How do I keep that last form I entered last the next time I open the data...

not continuing
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) I did the most recent upgrade for office and it wouldnt run it said to delete the PIDlist for microsoft office so i did and then it said to get the product key which i did and now when i put in the product key and push continue it wont continue it just stays on the same page it will go back but wont go forward what should i do? ...

increment through controls on form
I have a form that I've name the controls on it in such a way that I could determine through open args if it should be locked or not. Example any text box that begins with txtd would be unlocked with open args of 1. I was hoping there was a way I could just move through the controls in a loop and set that property with one function.....I'm not for sure how to accomplish this though. Does anyone have some sample code on how to "loop" through all the controls on a form and set the locked property? I can write the criteria portion if I could get a sample of how to ...

Outlook/Access 2003
I've been doing a lot of research and purchased (but haven't completely read) Sue Mosher's book. However, before I spend much more time I'd like to find out if my idea is even feasible. The basic idea is to create an appointment system for multiple therapists that can be used by a receptionist and other staff. Using Outlook and Exchange is very nice but the appointment data needs to end up in an Access table immediately. We can purchase SBS 2003 with Exchange 2003 or we can buy a third party tool for calendar sharing whichever would be the easiest to use. I currently...

Possible to create a rule to alert on BCC messages?
Using Outlook 2007/Exchange Server 2007 Hello: I sometimes miss that I'm receiving an email as a blind copy. I was hoping to create a rule to alert me when I'm in the BCC field. However, when using the rules wizard, I only see the options regarding my name in the To or CC field. Is there a way to create this that I may be missing? Thank you. In article <#pJLIK1ALHA.4704@TK2MSFTNGP06.phx.gbl>, victoria@dig.com says... > > Using Outlook 2007/Exchange Server 2007 > > Hello: > > I sometimes miss that I'm receiving an email as ...

How to create an XML document with XmlTextWriter?
Hi, I'm trying to create an XML document with XMLTextWriter but I want to store it in memory (not write it to a file like so many examples do). I tried the following but with no luck. Should I not user this object for this purpose? Thanks, Dave MemoryStream stm = new MemoryStream() XmlTextWriter writer = new XmlTextWriter(stm, System.Text.Encoding.UTF8) writer.WriteStartDocument() writer.WriteComment("This Is A List of My Books") writer.WriteStartElement("MyBooks") writer.WriteStartElement("Book") writer.WriteAttributeString("ISBN", "1861005...

Attach Trigger to Save Function of Form
I am in the processes of trying to attach a trigger to the Save function of an already existing GP form using Dex. In one of the documents, it states that the CM_Checkbook_Maitenance has a SaveRecord function. I am trying to acces the function that is similar to this on the PM_Vendor_Maitenance form. I tried using SaveRecord and when I tried to compile it it says that it is an unknown reference. Is there some documentation with a list of the functions for each form? Mike, PM_Vendor_Maintenance is an older form and probably doesn't have a SaveRecord function. Try running t...

look way to map form at CRM frontend to tables at CRM database
How can I find out what tables which new record has been added on when I enter data through a form in CRM front end? I try to find way to map form in the CRM frontend to the tables at the CRM database at backend? It is CRM 3.0 Thank in advances for help! ...

Create your personal SMS homepage, let friends send FREE text message to your mobile phone by web
Create your personal SMS homepage, let friends send FREE text message to your mobile phone by web Support over 147 countries and ALL languages (unicode encoding) MSG.to provides a unique personal SMS URL for you. It is easy for friends sending text message to you by web. For example, if your name is Lisa, you can register: http://MSG.to/Lisa (you can use this link to see demo) You can also register your mobile phone number as SMS URL like: http://MSG.to/+886913123456 (you can use this link to see demo) Please visit http://msg.to/ for more information. Related keywords: Short Message Serv...

upload form problem / server question
www.icingpictures.co.uk / win xp / frontpage 2003 Want to create a form with upload file form field - i read on this forum that the server type i use is important - it should be a windows type server with frontpage extensions - i currently use a linux server with front page extensions - do i need to change to a windows server? Thanks for taking a looka t my question. Joyce Yes, you must have a Windows Server, just like you stated you read. -- Tom [Pepper] Willett Microsoft MVP - FrontPage Since 1997 --------------------------- "threademporium" <threademporiu...

How do I view my calendar by a label I've created?
I would like to assign label colors to items in my calendars (for home use) and then be able to view my monthly calendar by one label at a time as I choose. Is there anyway to do this? I have gone through all the help menus and can't find anything. I found instructions on how to create a filtered view, but under the instructions, I have no "Add Filtered View" as one of my options. Any suggestions? View | (Arrange By) | Current View | Customize Current VIew | Filter --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtlefloc...

Is batch ID is required in payables transaction entry form?
Is batch ID is required in payables transaction entry form? How about if I just have 1 invoice and do not want to create a batch for it? can I still process the invoice? Hi Bab, A batch i.d. number is not required. You have to post your invoice both in the Payables module and also in the Financial module. I check weekly for any "series batches" that have not been posted in my A/P, A/R, P/R, and Financial modules. If they go unposted it can create havoc. I hope this has been helpful to you. -- Diana "Bab" wrote: > Is batch ID is required in payables transa...

can I create a new resume?
I would like to create a new resume. Can you help? This is the Microsoft Excel newsgroup. I am unaware of any newsgroup that provides help with resumes, but perhaps you intended to post in the Microsoft Word newsgroup, in which case, this tutorial may help you: http://www.officearticles.com/tutorials/write_your_resume_in_microsoft_word.htm ************ Anne Troy www.OfficeArticles.com "in need of help." <in need of help.@discussions.microsoft.com> wrote in message news:4245D9F3-C5CF-4C64-A70F-E8930F899954@microsoft.com... >I would like to create a new resume. Can you he...

Dynamic Access Report from filtered Form
I need help. I have succuess fully applied the "how to create a dynamic crosstab report in access" from instructions off of microsofts web site to my own report and query. My problem is this. I have a form in datasheet view, based off a query. When the form is open I can hide / unhid columns as needed and apply filter by form. That all is great. But now I want to beable to send the filtered data on the datasheet form to the Dynamic Report I created showing only the filtered records and also only show the columns that I did not have hidden on my form. How do I do this? I have t...

Creating an OWA access only user.
Hello chaps/ladies, The pointy hairs have asked that some one external to our organisation be given access to an email account within our organisation. So my thoughts were to create a user account and lock it down to prevent interactive access to any workstation machines in any way and only allow OWA access, this has prroven trickier than I first assumed. Does anyone have a quick guide going over best practices for this type of situation? TIA. -- Alex Griffin On Tue, 14 Jun 2005 16:26:11 +0100, Alex Griffin <nntpuser@hotmail.com> wrote: >Hello chaps/ladies, > >The pointy...