2
Answers

Fill grid with chunks of data - without logic code in visual layer

David

David

16y
2.9k
1
I've created a simple form containing a visual control that is modified by a thread. This application is written in Visual Studio 2005 (c#) and works fine.

I want to use this functionality in a major project. The solution file of this major project may contain the following projects:
*) main project: cfr. the main form
*) controls project: containing all of the visual controls I've designed. This also contains an inherited version of the DataGridView. All these contols are used onto the main form
*) Logic project: I don't want to write logic code into my visual controls. My forms and other visual controls have only the necessary code for adjusting the visual state of the controls (example enable/disable controls, ...)
*) other projects...

I want to do the following stuff: if one of my controls on the main form changes (user selects other radiobutton, changes date, selects another company in treeview, ...) a thread must be started. The thread retrieves the requested data and give it in chunks to the inherited datagrid. So the user doesn't have to wait until all data is retrieved! (I want to use this functionality with different grids)

Questions: How do you design this into a 3tier application? I don't want lots of references between my projects and I don't want logic into my visual layer. Does anyone knows an article about this (of has an example?) Every example I've seen concerning Threading and User Interface has all the code in one form!

Thanx!







Answers (2)