المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Database column mapping - draw lines between items in DataGridView



C# Programming
12-11-2009, 10:11 AM
Hi,

Summary: I need to draw lines between items in two DataGridViews to give a visual indication of source to target column mapping.

Details: First of all, I'm fairly new to DotNet and C# programming, but an experienced developer in other ********s and technologies. This is my first post to CodeProject. I've read the FAQs, searched the articles, searched Google, and skimmed several forums before deciding on this one. If this is the incorrect forum, please gently and politely point me in the right direction and correct an honest mistake.

I need to write an application that will allow the user to map source columns to target columns, then generate syntactically correct SQL. For the UI, I was thinking of using two DataGridViews, plus the "dictionary tables" to populate the DataGridViews. For the SQL, I intend to use NVelocity or something similar.

My vision is the user will select a column from the source DataGridView and drag it to the target column in the target DataGridView.

What I can't work out is how to draw lines between the source and target columns to give the user a visual indication of the column mapping. This is especially true for columns mapped that are scrolled off the DataGridView, either top or bottom.

Picture another scenario: an online quiz. Questions on the left, answers on the right, drag the question to the correct answer to map the two.

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

Finally, I'm not married to using a DataGridView, so if there's a better UI element to use, please let me know.

Kind Regards,
Scott