viewpoint-particle

Author Topic: Grid control, sourceGrid, etc  (Read 4160 times)

mathia

  • Newbie
  • *
  • Posts: 43
Grid control, sourceGrid, etc
« on: March 21, 2014, 12:50:03 pm »
Can anyone get me started with SourceGrid or recommend a grid control for displaying data?  I'm not doing anything fancy, just need a way to display tabular data.

Deana

  • Wilson WindowWare Tech Support
  • Pundit
  • *****
  • Posts: 1183
  • WinBatch® can do it.
    • WinBatch Tech Support Database
Re: Grid control, sourceGrid, etc
« Reply #1 on: March 21, 2014, 01:37:01 pm »
Take a look at the ReportView Control that is available in the WIL Dialog Editor.

The WIL Dialog Editor offers quick production of custom dialog boxes for your WinBatch programs. It provides a convenient method of creating dialog box templates for use with the  Dialog  function. For more information about the Dialog function see the Windows Interface Language help file.

Note: See the Windows Interface Language Reference help file for more details on how to use the  Dialog  function to further customize your dialogs, including adding callback procedures with in subroutines to make your dialogs dynamic.

It displays a graphical representation of a dialog box, and allows you to create, modify, and move individual controls which appear in the dialog box.

After you have defined your dialog box, the Dialog Editor will generate the appropriate WIL code, which you can save to a file or copy to the Clipboard for pasting into your WIL program.

Code: Winbatch
;Create an array of data to display
arrTunes = ArrDimension(6,2)
; Artists
arrTunes[0,0] = 'Artist' ; Header
arrTunes[1,0] = 'The Knack'
arrTunes[2,0] = 'Glenn Miller'
arrTunes[3,0] = 'Bee Gees'
arrTunes[4,0] = 'B-52s'
arrTunes[5,0] = 'The Champs'
; Songs
arrTunes[0,1] =  'Song' ; Header
arrTunes[1,1] =  'My Shirona'
arrTunes[2,1] =  'In the Mood'
arrTunes[3,1] =  'Staying Alive'
arrTunes[4,1] =  'Rock Lobster'
arrTunes[5,1] =  'Tequila'

style = 1048576|4194304 ;first header & single select

SongsFormat=`WWWDLGED,6.2`
SongsCaption=`Songs`
SongsX=236
SongsY=124
SongsWidth=152
SongsHeight=109
SongsNumControls=004
SongsProcedure=`DEFAULT`
SongsFont=`DEFAULT`
SongsTextColor=`DEFAULT`
SongsBackground=`DEFAULT,DEFAULT`
SongsConfig=0

Songs001=`029,087,034,014,PUSHBUTTON,"PushButton_OK",DEFAULT,"OK",1,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
Songs002=`071,087,034,014,PUSHBUTTON,"PushButton_Cancel",DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
Songs003=`017,031,108,048,REPORTVIEW,"ReportView_1",arrTunes,DEFAULT,DEFAULT,3,%style%,DEFAULT,DEFAULT,DEFAULT`
Songs004=`019,011,104,014,STATICTEXT,"StaticText_1",DEFAULT,"Choose your favorite song:",DEFAULT,4,DEFAULT,DEFAULT,DEFAULT,DEFAULT`

ButtonPushed=Dialog("Songs")
Message("Your Favorite Song is:",arrTunes[0,0]:" - ":arrTunes[0,1])


Deana F.
Technical Support
Wilson WindowWare Inc.

JTaylor

  • Pundit
  • *****
  • Posts: 1023
    • Data & Stuff Inc.
Re: Grid control, sourceGrid, etc
« Reply #2 on: March 21, 2014, 05:09:48 pm »
Yes.  The ReportView controls works well for simple displays.   If you need something beyond that I would recommend iGrid ActiveX control at http://www.10tec.com.   You can't bind to a datasource but other than that it is very good.   I use it extensively with WinBatch.

Jim

seckner

  • Jr. Member
  • **
  • Posts: 68
Re: Grid control, sourceGrid, etc
« Reply #3 on: March 26, 2014, 06:13:02 am »
Hi Jim! Thanks for the lead - it was a question that I was going to ask, however mathia beat me to it. What do you mean by "can't bind" - I'm hoping find a grid I can use with some SQL2008 queries, etc.. will this work?

JTaylor

  • Pundit
  • *****
  • Posts: 1023
    • Data & Stuff Inc.
Re: Grid control, sourceGrid, etc
« Reply #4 on: March 26, 2014, 06:29:03 am »
Some grids allow you to bind to your data source so changes in the grid are automatically made in the database.  iGrid does not work that way.   You can "Open" a recordset and they have a Method named FillFromRS() which allows you to populate your grid with the contents of the Recordset but if you edited a cell in the grid that would not update your Recordset.  You would have to do that yourself.   I have very few cases where I want, or even allow, cell/grid editing so that isn't a big issue for me.   I've tried out several different grids and iGrid, by far, is the easiest to implement and use.  Also, apart from the data-binding I can't see any great difference in capabilities and their price is MUCH better than most, at least it was several years ago...haven't checked lately.


Jim

stanl

  • Pundit
  • *****
  • Posts: 945
Re: Grid control, sourceGrid, etc
« Reply #5 on: March 26, 2014, 12:33:43 pm »
I'm hoping find a grid I can use with some SQL2008 queries, etc.. will this work?

You can use OWC with SQL Server and it's free from MS. Also, if you can google a location that still permits a download of the Flexgrid7 (freeware, before they went commercial), that is a fully-functional .OCX that I used with WB for years. Additionally, Logparser can produce non-editable grid output from a variety of sources. All of these options can be searched in the Tech DB.
 
Finally, there is a .NET grid class that the latest WB can access. It is also limited at this point to a simple display (similar to the Powershell grid output), but as Tony has introduced the use of the CScharpProvider class to improve your capabilities with the CLR... who knows

mathia

  • Newbie
  • *
  • Posts: 43
Re: Grid control, sourceGrid, etc
« Reply #6 on: March 31, 2014, 09:12:16 am »
Thanks to everyone for their suggestions. I ended up going with reportview just because of the availability of it and being able to find examples.  I remember using Flexgrid int he past, but never had enough time to fiddle with it enough to get it working to my satisfaction.  Wish I still had a copy of it as it showed some promise.