views:

112

answers:

4

Hi,

for a Windows application I need to read in fixed block files which need to be splitted in fields. I would like to this like in excel or openoffice where I have a preview of the file and can graphically define where the line should be splitted.

Does anyone know some control for .net which supports this, or any sample code where this is demonstrated? Or even some hints how to do it?

Thanks, Michael!

Image of the Excel wizard

I've found a MFC-Control on CodeProject. Column Separator Control I will try to rewrite it to C#.

A: 

Well it might help if you expand a little more, maybe with an example?

If I understand the question right a DataGridView sounds worth looking into. It's basically a table that you bind to a datasource. There are quite a lot of examples on the MSDN site using them.

Re-reading if you are interested in displaying the actual text, and then setting a position to split the text, you could maybe just display the contents in a text box? Then you'd have to deal with the cursor position and keep a record of where it was last placed.

Ian
I have added a screenshot of the Excel wizard. I think it should be some kind of a textbox with the possibility to draw on it and get back the information between which columns the line was drawn.
Michael
Right, a picture does speak 1000 words :) Have you tried emailing them see where they got the control from/if you could buy a copy of it?If not I can't imagine it should be too hard to implement? Custom drawing of a line on top of the text box, and keeping the scroll bars in sync is the biggest thing.I don't think I've ever seen a control like this before....
Ian
No I haven't mailed to Microsoft yet. ;-) Since it's more a nice to have feature, I didn't spend so much time on this. But I found one control on CodeProject. Unfortunately it's not a .net Control.
Michael
Ah, I see. Didn't realise it was embedded in Excel. You can incorporate MFC into a C# app I believe, although it's not so nice. Or you could port it to C# depending on the licence.
Ian
A: 

I know the dialog in Excel you're talking about, but I've never seen a similar control. I think you'll have to implement your own control for that.

Thorsten Dittmar
A: 

The only thing I have found is the required control for MFC on CodeProject (see question). It seems I need to rewrite the control for C#/.net.

Michael
A: 

We have written our own control for that in C#. If anyone is interested in that control please contact me. Maybe we will release it then.

Michael