Page 1 of 1

Forms on the fly

Posted: Wed Apr 02, 2014 3:00 pm
by boyddt_co
I originally posted this in the PrimalForms forum an they directed me here.

I have a project that I'm working on whose output is going to vary depending on the operator using it. Basically it is a table with 7 columns and x number of rows - with the rows being dependent on the number of machines in a cell. The row count could be anywhere from 1 to 12. As I query data from SQL I'd like to custom build the form at run-time so that I'm only showing a table big enough to hold the data.

If I can't have the form built dynamically, can I have multiple forms, one for each of the twelve possibilities and call the form based on the number of machines in the cell?

I'm including a screen shot of a mock-up in Excel to better illustrate my desired outcome. This mock-up would be all the machines in one cell.

Thanx in advance,

David

Sample.png
Sample.png (70.34 KiB) Viewed 2490 times

Re: Forms on the fly

Posted: Wed Apr 02, 2014 3:30 pm
by jvierra
The DataGrid control is dynamic. It can take a datatable and automatically adjust to the available data.

What else could be better.

Re: Forms on the fly

Posted: Thu Apr 03, 2014 2:49 pm
by boyddt_co
Ok, so the datagrid view is dynamic, is it interactive? What I would need to do is to allow an operator tap on a cell when the product goes into production. This would change the appearance to show that it is in process. A second tap would allow the operator to change the appearance again to denote that it is finished. Can we do that with the data grid?

Thanx in advance.

Re: Forms on the fly

Posted: Thu Apr 03, 2014 3:23 pm
by jvierra
That is what the DataGrid and DataGridView controls do.

Take some time to review the blog posts on how to design Forms. You will see that this is all very easy once you know the basics.

http://www.sapien.com/blog/topics/user- ... istrators/

Once you know how the eventing model of Windows is used in forms and how to set up and navigate your controls forms design and implementation becomes fairly easy.