Why is there no GRID


I am a little disappointing to find that there is no grid control in XOJO, all other major languages, VB6, Visual Studio.Net and correct me if I am wrong on this one Delphi all had a grid control that allowed database content to be displayed.

I use grid controls in my person and work projects a lot and with out a grid control of some description I will be staying with Visual Studio 2010 and moving to 2012, when I have the cash to purchase it.

I was looking at XOJO as a cross platform tool instated of MONO which I think is a little buggy to say the least.

Please please please add a grid control. That can have data binding.

Coming from a Business database development background I rail need a drag and drop grid that got data bindings.

Isn’t the listbox suitable for your purpose? This component allows for multiple columns and customization.

It’s soooo easy to do that yourself. Really.

Woops did not know about the listbox been data bound I have a look at that!

I think it isn’t. But doing that in code is really not that hard and much much more flexible.

Many people use the Einhugur grid. Yeah, it’s a third party add-on that cost a little bit of money, but if you are looking for the “cheapest” route to a great cross-platform tool with all the goodies, you are not at the right place. The best (and in my opinion, only) reason to use RS / Xojo is it is the best tool for producing applications for the Mac / Windows / and to some extent Linux. If you just need to produce applications for just one platform, there are other solutions out there that aren’t hooked to the X-platform ball-and-chain, which often means falling back to the lost common denominator to reach all 3 platforms.

But, really the Einhugur controls are quite a bargain when you consider how many you get for the money. The Monkeybread plugins are great as well, and I like the Jeremie Leroy controls a lot as well.


Data binding is quick, easy, and very limiting.

The problem with doing that in code with the Listbox, is there is no property for turning off drawing while you load the Listbox. For smaller displays of data its not a problem, but when there is a larger recordset to display it is not very smooth. WIth the Einhugur grid (and many others), you can turn off the drawing and turn it on at the end, much smoother. Making the ListBox invisble is not really much better in my opinion.

The Listbox can be data bound but you outgrow this integration so quickly you end up doing it yourself. It may be a good idea to start from scratch your own binding.

This old sticky from the previous forum has enough info to get you started. It kicks off right with methods to populate data into a listbox.


If you prefer the third party route Einhugur’s Datagrid is very popular.

@Melvyn Pate
Thanks for the tip on Einhuger controls. Worth a look!

Sure, and don’t forget, http://www.bkeeney.com/ lots of good stuff there as well.

Question, can you bind the ListBox to a recordet like you can in VB6? I have never been a fan of binding a grid to a database table or a field, but in VB6, you can build a recordset with an SQL query and have that recordset bound to the grid as the data source, and it is lightning quick. Before I purchased the Einhugur grid, I think looked at this with the ListBox and it couldn’t do it or the flicker problem I mentioned kept me from using, I can’t recall. Now I just use the Einhugur Grid for all but the smallest chores.

Not as far as I know. You need to use the AddRow() method or Cell() properties to fill the Listbox. There is no direct binding with a RecordSet or a (prepared) SQL query. By flickering you mean the effect when filling the ListBox?

Right. With Einhugur Grid you can turn off drawing, do all the loading of data formatting, styles. etc… then turn drawing back on, and it all shows up at once and seemlessly. One oddity, in Real Studio I didn’t have to do this, but in Xojo, some of my screens require that I do a MyEinhugurGrid.Refresh to make it load smoothly on Windows. WIthout that, it flickers badly.

But with the ListBox, you can’t turn off drawing, and when the list starts getting to 50+ records, I start to notice the flicker when you load it with data and format cells.

Make it ivisible, load the data and make it visible again?

Not sure what you mean…

Within single method making the listbox invisible does NOT make the listbox invisible WHILE the method us executing but does stop drawing and the listbox on screen does not dsappear . If you make it invisible at the start of method, load data and make it visible again why is it not the same thing?

To test listbox loading speed I put an 8 column list box on Window.

I Dimed this as a Window property:

Dim D(100000,7)

And in open put

[code] Dim i,j as Integer

For i = 0 to 100000
For J = 0 to 7
D(i,j) = Str(i)+“Xhhg1ef12fe1efljl”+Str(j)

I put a button on the window and in it’s action event I put:

Sub Action()
  #pragma DisableBackgroundTasks
  #pragma Disable BoundsChecking
  Dim T as Double = Microseconds
  Listbox1.Visible = False
  For i as Integer = 0 to 100000
  Listbox1.Visible = True
  T = Microseconds  - T
  Dim T1 as Double = Microseconds
  Listbox1.Visible = True
  For i as Integer = 0 to 100000
  Listbox1.Visible = True
  T1 = Microseconds  - T1
  Listbox1.AddRow Format(T/1e6,"0.00\\s\\e\\c"), Format(T1/1e6,"0.00\\s\\e\\c"), Format(T/T1,"0.00")
End Sub

For that I got

0.75sec 2.03sec 0.37

Loading 100,000 rows into a listbox took 0.75 sec with it “invisible” and 2.03 sec visible. So making it invisible makes it 2.7 fold faster…

So l don’t think listbox loading speed is a significant issue in most cases.

  • Karen

Thanks for the plug. :slight_smile:

If speed is the critical then I’d say get the Einhugur StyleGrid. It has a number of features (lock drawing, variable row height, column spanning to name a few) that make it superior to the ListBox in many ways.

The drawback is that it looks slightly different from the Listbox so you can’t really mix and match. Once you use it you’ll want to use it everywhere in your app. The other big drawback is that some functionality is only achieved through subclasses (i.e. column resize and cell edit).

For big data sets DataGrid might be better than StyleGrid
They share a lot of common features like styling etc

If chucking the loading of the Listbox into a thread, doesn’t this alleviate the ‘not being able to use other parts of the window’ problem. I’m currently in the process of subclassing a listbox, getting it ready for my project, and came across this issue. I hope this is what you’re referencing, if not I’ll sit back down.

Tried it…I’m usually not foolish enough to argue with Karen on the ListBox because she knows a heck of a lot more about than me, but having the Listbox disappear for 0.75 seconds then reappear is not what I would call desirable. I can do the same thing with the Einhugur grid, and the Grid just updates. Much smoother than the ListBox. Now my data that my program usually works with is is smaller so the delay is much shorter, but it give the apperarance of the grid blinking.