Database column mapping - draw lines between items in DataGridView

G

Guest

Hi,

I need to write an application which allows the user to map source to target
columns in a data base. The UI will be:

* Two ListBoxes, TreeViews, or DataGridViews (which I will generically call
"display widget") which list the columns in the source and target database
tables (I haven't decided on the best UI widget yet).
* The user drags and drops a column from source/target to map it to the
target/source column
* Or, the user selects a column in each display widget and clicks the "Map
Column" button (another UI widget)

I can code all of the above. However, I want to draw lines between the
source and target columns to indicate which columns are mapped. I also
need the lines to converge at the top and bottom of the display if the
mapped column is "off the screen". The lines need to redraw properly as the
user scrolls the display widgets.

Here is a screenshot which approximates my desired UI:
http://support.sas.com/documentation/cdl/en/etlug/60948/HTML/default/images/rec-sql-sel-clause.png

As I see it, I need:

* the end (right hand side) pixel location for the selected source column
* the beginning (left hand side) pixel location for the selected target
column
* the min pixel location at the top of each display widget
* the max pixel location at the bottom of each display widget

As a simple test case:

* Create two listboxes
* Load the left one with "A" - "Z"
* Load the right one with "A" - "Z" in random order
* Size the listboxes so that only a portion of the data displays without
scrolling
* Write some backend test code to map each letter to each other.
* Draw lines to all objects. The lines should not "draw off screen" if the
item is not currently visible in the listbox.

This is analogous to an online quiz, with questions on the left, answers on
the right, and the user needs to map the question to the answer.

Is there any example code in the public domain that does this, or something
similar? Otherwise any design ideas are greatly appreciated.

Thanks,
Scott

P.S.: Is there a microsoft.public... newsgroup for WPF, or is this the best
place to post WPF questions?
 
J

Jeff Gaines

Is there any example code in the public domain that does this, or
something similar? Otherwise any design ideas are greatly appreciated.

I wrote an app to import csv data into a custom format for a PIM.
I decided that drawing lines between 2 x List Views (or similar) could be
confusing. What I did was to have a List View on the left with 2 columns
and a form on the right with labels for each field. The use selects the
field in the first column of the List View and drags it to the appropriate
field on the form on the right. Background code then added the name of
that field to the List View.

If you want to see how it works the source is at:
http://www.jgaines.me.uk/html/barca_contacts.html

You can test it with any csv file.
 
N

Neitcouq

Hi Scott, amazingly you're doing exactly what I am doing and you meet a
problem exactly what I meet.
Has any solution ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top