PC Review


Reply
Thread Tools Rate Thread

Database column mapping - draw lines between items in DataGridView

 
 
Guest
Posts: n/a
 
      16th Jan 2010
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...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?


 
Reply With Quote
 
 
 
 
Jeff Gaines
Guest
Posts: n/a
 
      16th Jan 2010

On 16/01/2010 in message <(E-Mail Removed)>
<(E-Mail Removed)> wrote:

>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.

--
Jeff Gaines Dorset UK
There is absolutely no substitute for a genuine lack of preparation
 
Reply With Quote
 
Neitcouq
Guest
Posts: n/a
 
      10th Feb 2010
Hi Scott, amazingly you're doing exactly what I am doing and you meet a
problem exactly what I meet.
Has any solution ?
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGridView: Column Header with 2 lines osmarjunior Microsoft C# .NET 1 23rd Sep 2006 06:49 AM
DataGridView (.NET 2.0 Windows Forms) Text wrapping in DataGridView Items Chris Hayes Microsoft Dot NET Framework 1 27th Aug 2006 06:07 PM
Draw lines, pset points, draw circles on a report =?Utf-8?B?aGdlcm9u?= Microsoft Access Reports 6 23rd May 2006 07:41 PM
Mapping a boolean field in a SQL CE database to a human-friendly DataGrid column Jared Miniman [MVP] Microsoft Dot NET Compact Framework 1 25th Sep 2003 02:55 AM
Mapping a boolean field in a SQL CE database to a human-friendly DataGrid column Jared Miniman [MVP] Microsoft Dot NET Compact Framework 0 24th Sep 2003 11:02 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:33 AM.