APL/W Grid Object versus WPF DataGrid

Using (or providing) Microsoft.NET Classes

Re: APL/W Grid Object versus WPF DataGrid

Postby kai on Tue Jul 06, 2010 6:41 pm

I am suffering from the usual difficulties when trying to make Michaels function work; the statement:

g←⎕NEW DataGrid

caused a VALUE ERROR on my machine.

With a bit of googling I figured out that DataGrid should be part of WPFToolkit.dll, a relatively new part of WPF. A search on my disk found this DLL in two locations:
C:\Program Files (x86)\WPF Toolkit\v3.5.40619.1\WPFToolkit.dll
C:\Program Files (x86)\Microsoft Expression\Blend 3\WPFToolkit.dll

I also found that the Using statement
⎕USING,←⊂'System.Windows.Controls'
is probably in charge for making DataGrid accessible, so I tried
⎕USING,←⊂'System.Windows.Controls,c:\Program Files (x86)\WPF Toolkit\v3.5.40619.1\WPFToolkit.dll'
but without luck. So I am stuck.

I don't know how often I ended up like this with a VALUE ERROR on a .NET object but it feels like hundreds of times. Am I the only one?!

Kai
User avatar
kai
 
Posts: 137
Joined: Thu Jun 18, 2009 5:10 pm
Location: Hillesheim / Germany

Re: APL/W Grid Object versus WPF DataGrid

Postby MikeHughes on Wed Jul 07, 2010 7:04 am

Kai,

The DataGrid is now included in WPF4 which is the latest version and comes as part of the latest version of .Net (4).

The reason for value errors is usualy the result of not having sufficient entries in your []using - like []path for Dyalog namespaces. In this case I suspect it is because you havent upgraded to .Net 4.

Sorry I should have said that my examples come from .Net 4 but as Dick was having problems with DataGrid I assumed he knew that but forgot that others may not.

If you have ,Net 4 installed and are still having problems I can post a workspace that should work if its of any help to anyone.
User avatar
MikeHughes
 
Posts: 86
Joined: Thu Nov 26, 2009 9:03 am
Location: Market Harborough, Leicestershire, UK

Re: APL/W Grid Object versus WPF DataGrid

Postby MikeHughes on Wed Jul 07, 2010 9:50 am

Thats one of the good ones :-)

On different aspects of WPF - I have found the following useful

Commands:
http://codeblitz.wordpress.com/2009/03/ ... -1-basics/

New Controls (includign DataGrid) -videos

http://www.msdev.com/Directory/Descript ... entId=1673

I have lost the others - sorry - but prefix your search with wpf4 and you usually get quite alot of good stuff

You might consider the free Visual Studio 2010 Express which includes a xaml editor/designer. You need to download the Visual C# or VB express edition to get it.
User avatar
MikeHughes
 
Posts: 86
Joined: Thu Nov 26, 2009 9:03 am
Location: Market Harborough, Leicestershire, UK

Re: APL/W Grid Object versus WPF DataGrid

Postby MikeHughes on Wed Jul 07, 2010 9:55 am

User avatar
MikeHughes
 
Posts: 86
Joined: Thu Nov 26, 2009 9:03 am
Location: Market Harborough, Leicestershire, UK

Re: APL/W Grid Object versus WPF DataGrid

Postby Dick Bowman on Wed Jul 07, 2010 10:24 am

MikeHughes wrote:[... deleted ...]

The reason for value errors is usualy the result of not having sufficient entries in your []using - like []path for Dyalog namespaces.[... deleted ...]


I find that quadUSING is a mysterious thing - earlier in the year I found myself in a situation where I seemed to have to use all three of the "styles" (something, ,something and something,something).

What I use with WPF/XAML is Jonathan's #.WPF.Using function from 2008 - I've been frustrated by errors along the lines "Calendar is not a useable control" when VB has created the XAML file and is quite capable of showing it. I don't know whether this comes from an inadequate quadUSING or the <xmlns> mumbojumbo that begins the XAML file (I need the book).

I wonder whether Dyalog might formally enlighten us, by more documentation and/or sample code - it's a little (well, a lot) frustrating to be blundering around somewhat by trial and error.
Visit http://apl.dickbowman.com to read more from Dick Bowman
User avatar
Dick Bowman
 
Posts: 235
Joined: Thu Jun 18, 2009 4:55 pm

Re: APL/W Grid Object versus WPF DataGrid

Postby Dick Bowman on Wed Jul 07, 2010 10:30 am

MikeHughes wrote:Thats one of the good ones :-)

[... deleted ...]

I have lost the others - sorry - but prefix your search with wpf4 and you usually get quite alot of good stuff

You might consider the free Visual Studio 2010 Express which includes a xaml editor/designer. You need to download the Visual C# or VB express edition to get it.


I was rather afraid that it would be one of the good ones...

Personally I don't get on with videos as a way of learning stuff - I get more from free-format drop-in-and-look-up styles (I'm even old enough to remember what books were).

I have the VS2010 VB Express - I can rant about that as well.
Visit http://apl.dickbowman.com to read more from Dick Bowman
User avatar
Dick Bowman
 
Posts: 235
Joined: Thu Jun 18, 2009 4:55 pm

Re: APL/W Grid Object versus WPF DataGrid

Postby MikeHughes on Wed Jul 07, 2010 9:22 pm

[]Using is confusing I agree. I still dont understand the difference between []using←'' 'System' and []using←,⊂'System'

Both produce (System.Double) when you type Double but the single entry of []using←,⊂'System' produces a value error for System.Double but (System.Double) for Double !! Put the Enclose empty back []using←'' 'System' and both work again!! At the moment I just accept the difference and make sure all my []Usings include a ,⊂''.

Jonathan's list is only the start - for most things you need about double that as different jobs/controls need different entries in the []using. You will find as you use certain utilities with controls you will localise and set []using to different values. Most of the documentation in msdn on each class state at the top of the documentation which namespaces and corresponding dlls you need to specify in []using.

For example: You need two entries in the []using for automation.peers to do sopme of the stuff Simon did with playing cards and to simulate a programatic click on a button (a wierd construct). If you dont want to do this you dont need them etc etc

Jonathan only set sufficient entries in his []using for his demo workspace to work.

Thats why my []using entries for the DataGrid are different and longer than the original #.WPF.Using.

I have found several bugs in the interface while I have been learning and evaluating WPF - and I have to thank John Daintree for fixing them very speedily. However I have found as a general rule, a value or length error normally means I am doing something wrong rather than there being anything wrong with Dyalog's interface. I think I have had egg on my face many more times than John has had to fix something.

I admit WPF is a struggle to learn and not obvious at first but persevere because once the penny drops it opens up a vaste set of possibilites to you and Dyalog will soon have absolutely no reason to develop their GUI elements further - in fact they would be totally mad to waste time doing so. With the arrival of Silverlight (basically WPF within the browser) and the promised APL# - the only way forward is going to be WPF or its succcessor.

It is possible to embed the WinForms controls into WPF and so I believe (although I've no intention of doing it unless I have really have to) it shoulod be possible to use your favourite controls including the APL/W grid from within a WPF application. The only limitiation that seems to be stated is that WPF or Winforms/Dyalog have to be responsible for a given pixel on the screen so you can't have WPF and non WPF controls overlapping - quite what that means in practise I don't know.

I am a freelance consultant so if anyone would like any advice / help with a WPF project they are planning please feel free to contact me privately Michael@Hughes.uk.com
(Advert over sorry!)
User avatar
MikeHughes
 
Posts: 86
Joined: Thu Nov 26, 2009 9:03 am
Location: Market Harborough, Leicestershire, UK

Re: APL/W Grid Object versus WPF DataGrid

Postby Dick Bowman on Thu Jul 08, 2010 12:55 pm

MikeHughes wrote:[... deleted ...]
I admit WPF is a struggle to learn and not obvious at first but persevere because once the penny drops it opens up a vaste set of possibilites to you and Dyalog will soon have absolutely no reason to develop their GUI elements further - in fact they would be totally mad to waste time doing so. With the arrival of Silverlight (basically WPF within the browser) and the promised APL# - the only way forward is going to be WPF or its succcessor.[... deleted ...]


I can never resist an evangelist...

I don't know where Dyalog are trying to position themselves as a development tool - but one counterargument might be "here is a nimble self-contained environment which has everything you need to speedily develop adequate solutions" which is then pitched at statisticians, pigfarmers and other "domain experts".

On the other hand, pitching into "here's something that you can use in the same way as Visual Studio except you'll have to do your own translations from the official documentation" and aiming at corporate developers seems to be another story. And one fraught with risk - not least because many people are likely to say "if all I'm doing is bolting together .Net components I might as well use the mainstream tools".

I think there are ways ahead - having alternatives always seems good to me.
Visit http://apl.dickbowman.com to read more from Dick Bowman
User avatar
Dick Bowman
 
Posts: 235
Joined: Thu Jun 18, 2009 4:55 pm

Re: APL/W Grid Object versus WPF DataGrid

Postby MikeHughes on Thu Jul 08, 2010 3:50 pm

Hmmm - neither can I so I won't begrudge you the pleasure of whatever you are planning.

APL is a very flexible language but it still needs to talk to the outside world. However good your algorithms, however good the calculation enginge it still needs to get its results out and its inputs in.

Users are very perceptive about what is usual and what is clunky. Users are becoming more video and pictorially orientated rather than text based - I may not like it, you may not like it but they are. The number of video training sessions on the net shows this. Resistance to use occurs as soon as anything is perceived as "legacy" or "Blocky" - its always perception or lack of investment but it matters.

.Net is only an environment to exist in, just like raw Windows, DOS, MVS, VM etc before it. WPF is only a front end tool but one which is currently streaks ahead of any other at the moment. We could all be back with AP126 and GDDM if we took the attitude "we have what we have and its good enough". Its never good enough.

The real difference between APL and the C# type languages is in the sucinctness and the array handling abilites. I struggled when I first met GDDM but soon built GUIs that looked better than the non APL systems. This is going to be true here. If we are just going to link .Net/WPF commands together then we are doing no better than just linking Ctls assignments together with our AP interfaces and we might as well learn C#.

AP126 blossomed when we had utilities to use it. The APL Guis are the same. I bet we all have our own set of preferred utilies rather than using raw []wc []wg and []ws. This is how we should use WPF - accept the new environment, learn by doing the translations but THEN create our own APL like utilities to maximise the results.

If we do that, as with the GDDM (and the others), we can write better, more flexible GUI front ends than Visual C#.

We may have to bend the rules of interaction but we've always done that right back to APLSV....but you have to knowe your environment before you can exploit it - so yes the start is a slog of translation but the benefits are worth it in the end I think.

I have no idea what Dyalog are planning for their product but I want it positioned so I can provide solutions and to develop in all the Windows and Linux/Unix environments. I dont want to limit myself to any area and I think we can all live together. We just have to learn the rules before we can break them effectively.

I plan to have a set of utilities that mean I never have to type another []using or system.whatever unless I am building a utility function to extend my set. That way neither you nor Kai would know they were using WPF. That is my plan - I'm not there yet. Just because its difficult to start doesnt meean we should give up at the beginning.
User avatar
MikeHughes
 
Posts: 86
Joined: Thu Nov 26, 2009 9:03 am
Location: Market Harborough, Leicestershire, UK

Re: APL/W Grid Object versus WPF DataGrid

Postby Dick Bowman on Fri Jul 09, 2010 6:35 am

MikeHughes wrote:[... deleted ...]
AP126 blossomed when we had utilities to use it. The APL Guis are the same. I bet we all have our own set of preferred utilies rather than using raw []wc []wg and []ws. This is how we should use WPF - accept the new environment, learn by doing the translations but THEN create our own APL like utilities to maximise the results.

If we do that, as with the GDDM (and the others), we can write better, more flexible GUI front ends than Visual C#.[... deleted ...]


I don't think we're disagreeing so much as me (just this once) worrying about the tone.

My take - at present - is that WPF is useable, but I'm not finding much "wow" about it. And in some ways it feels like a 50kg rucksack on my back when I want to go for a jog (me?).

Anyhow, what I like is the idea of making utilities and telling people about them - that's one thing I'm planning to do. Maybe my experiences and directions will prove daft - but they'll be out there to help people do better. We need an APL-centric equivalent of Moser's tutorial pages. Because it will help make APL feel welcoming to those newcomers we hear of.

And I'll quite happily accept a situation where we have more than one set of utilities/tutorials/etc.

The only thing that really bothers me is that other programming languages seem to have gone down this road several years ago - we may be playing catch-up and they may already be moving on to the next big thing.

Oh, and I think there are other reasons for the profusion of video "tutorials".
Visit http://apl.dickbowman.com to read more from Dick Bowman
User avatar
Dick Bowman
 
Posts: 235
Joined: Thu Jun 18, 2009 4:55 pm

PreviousNext

Return to Microsoft.NET

Who is online

Users browsing this forum: No registered users and 1 guest