Jump to content


Photo

[4.3.6] Filling grid dynamically?


  • Please log in to reply
6 replies to this topic

#1 littlebigfred

littlebigfred
  • Members
  • 176 posts

Posted 10 May 2008 - 09:30 AM

Hello

I'd like to have a NextDBGrid be automatically filled by data living in an SQLite database through a DISQLite component:

http://img169.images...xtdbgridsg3.gif

Since I can see the headers at run-time, I assume NextDBGrid is able to read all the records from the DataSource, but I don't actually see any records:

http://img382.images...tdbgrid2nf3.gif

At design-time, if I set DataAwareOptions > doRetrieveRecords from False to True, I guess the following run-time error: "DISqlite3UniDirQuery1: Operation not allowed on a unidirectional dataset"

Here's the code:

http://pastebin.ca/1013534

Any idea why this occurs?

Once this works, the next step is to be able to double-click on a row, display a two-column grid to let the user make changes, and save them back to the database.

Thank you.

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,194 posts
  • Gender:Male

Posted 11 May 2008 - 12:08 AM

Hello Fred,

I was looking for whole day, and it seems that only logical that your kind of DataSet is unidirectional which is currently not supported by NextDBGrid sad.gif

This is one of compromise that I have need to made. I hope that I will find a way in future to solve it.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#3 littlebigfred

littlebigfred
  • Members
  • 176 posts

Posted 11 May 2008 - 01:49 AM

Hi

QUOTE (Boki (Berg) @ May 11 2008, 01:08 AM) <{POST_SNAPBACK}>
I was looking for whole day, and it seems that only logical that your kind of DataSet is unidirectional which is currently not supported by NextDBGrid sad.gif This is one of compromise that I have need to made. I hope that I will find a way in future to solve it.


I don't know how all those components work together, but according to DISQLite's forum, a DB-aware control can be connectedto it by adding a TDataSetProvider and a TClientDataSet: "The behavior of DISQLite3 is quite similar to the dbExpress TSQLQuery component. TClientDataSet is used as a local memory buffer, TDataSetProvider to
resolve update from the client dataset."

If it helps, here's a sample on how to connect DISQLite to a ClientDataSet: http://pastebin.ca/1014163

But I don't know how to configure the ClientDataSet control and the grid so that rows show up automatically in the grid. Or must I manually create columns in the grid and tell it which SQL column maps to which grid column?

Are there other users who connect NextDBGrid to (DBX?) unidirectional DataSets?

Thank you.

#4 littlebigfred

littlebigfred
  • Members
  • 176 posts

Posted 12 May 2008 - 11:11 PM

After looking at samples, I figured it out, and I can now SELECT data from a DB, and display them in a NextDBGrid, using a DB + unidirectional DataSet + DataSetProvider + ClientDataSet. Thanks for the help.

#5 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,194 posts
  • Gender:Male

Posted 12 May 2008 - 11:17 PM

Hello Fred,

I am sorry for not being much helpfull. Just not sure where I can look. I hope that you will find solutions faster in future.

To give my apologize, please tell me for one of features that I may into Next Collection suite.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.

#6 melodyman

melodyman
  • Members
  • 1 posts

Posted 10 June 2009 - 07:01 PM

QUOTE (littlebigfred @ May 12 2008, 05:11 PM) <{POST_SNAPBACK}>
After looking at samples, I figured it out, and I can now SELECT data from a DB, and display them in a NextDBGrid, using a DB + unidirectional DataSet + DataSetProvider + ClientDataSet. Thanks for the help.


Could you share this? I have also been looking for a way to do this.
Thanks in advance


#7 xr1140

xr1140
  • Members
  • 13 posts
  • Gender:Male
  • Location:Bucharest
  • Interests:vfx artist during the day, delphi programmer during the night

Posted 11 February 2010 - 08:07 PM

QUOTE (littlebigfred @ May 13 2008, 12:11 AM) <{POST_SNAPBACK}>
After looking at samples, I figured it out, and I can now SELECT data from a DB, and display them in a NextDBGrid, using a DB + unidirectional DataSet + DataSetProvider + ClientDataSet. Thanks for the help.



sounds to me that your CDS was empty ... so this has nothing to do with NextDBGrid




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users