Jump to content


Photo

NextDBGrid and filtered table


  • Please log in to reply
11 replies to this topic

#1 Marc

Marc
  • Members
  • 62 posts

Posted 09 September 2007 - 10:35 PM

Hi,

I have a Table filtered by a Filter method.

A combo box on the form to modify the filter.

Which method to use to refresh correctly the NextDBGrid (mono selection and not buffered records) ? unsure.gif

After modification of the filter, NextDBGrid has a strange comportement if selected record (before modify the filter) is not the first record and in a next page (scroll). I think that there is a desynchronization between TTable and NextDBGrid at this moment sad.gif

Use of Refresh method of the NextDBGrid don't fix this issue.

Thanks!

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 09 September 2007 - 11:11 PM

Hello Marc,

Can you please send me one small demo to I test it please. It will help a lot.

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 Marc

Marc
  • Members
  • 62 posts

Posted 11 September 2007 - 12:36 AM

QUOTE (Boki (Berg) @ Sep 10 2007, 12:11 AM) <{POST_SNAPBACK}>
Hello Marc,

Can you please send me one small demo to I test it please. It will help a lot.

Best regards


Simply, add a button in the Demo2 of NextDBGrid component with this code :

Table1.Filter := 'Salary > 20000';
Table1.Filtered := True;
Table1.Refresh;

Run the demo. Activate the Table. Move down the grid with keyboard or mouse.

Click on the Filter button.

If you use page up/page dn or wheel mouse, you can see that lines painted are updated by another data when selection is modify.

Other bug, when you use up keyboard, the scrolling paint the same first line on all lines of the grid is painted when you reach top of the table. Probably because internal record count of dbgrid isn't updated with the filter applyed...

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 11 September 2007 - 12:44 AM

Hello Marc,

Thank you, this is unfortunately same bug from:
http://www.bergsoft....?showtopic=1653

As I say there, current solution is to disable MultiSelect (goMultiSelect in Options), or enable buffered mode (doBufferRecords in DataAwareOptions).

I am intensively working on it and I hope that it will be finished in next several days. I am sorry again.

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.

#5 Marc

Marc
  • Members
  • 62 posts

Posted 11 September 2007 - 12:47 AM

QUOTE (Boki (Berg) @ Sep 11 2007, 01:44 AM) <{POST_SNAPBACK}>
Hello Marc,

Thank you, this is unfortunately same bug from:
http://www.bergsoft....?showtopic=1653

As I say there, current solution is to disable MultiSelect (goMultiSelect in Options), or enable buffered mode (doBufferRecords in DataAwareOptions).

I am intensively working on it and I hope that it will be finished in next several days. I am sorry again.

Best regards


I have updated my post. My grid has a multiselect option to false

#6 Marc

Marc
  • Members
  • 62 posts

Posted 11 September 2007 - 12:55 AM

QUOTE (Marc @ Sep 11 2007, 01:36 AM) <{POST_SNAPBACK}>
Other bug, when you use up keyboard, the scrolling paint the same first line on all lines of the grid is painted when you reach top of the table. Probably because internal record count of dbgrid isn't updated with the filter applyed...


+ use a big scroll with wheel mouse, display will be entirely corrupted... Already fixed in a previous release but re-appear in 4.1.5 blink.gif

#7 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 11 September 2007 - 12:57 AM

Hello Marc,

I have spot it too sad.gif I will work on it. It seems that VertScrollBar is not updated when Filter is applied.

I have try now with adding:

CODE
NextDBGrid1.VertScrollBar.First;


After applying fiter and it work at first check, but I will continue to work on 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.

#8 Aurelio - Brazil

Aurelio - Brazil
  • Members
  • 1 posts
  • Gender:Male
  • Location:Brazil

Posted 24 September 2007 - 08:20 PM

Hello Marc,
To resolve your problem, do it:

CODE
//Disconnect the grid
NextDBGrid1.DataSource := nil;

//Filter table
DataSet.Filter := 'any filter';
DataSet.Filtered := true;
DataSet.Refresh;

//Reconnect the grid
NextDBGrid1.DataSource := DataSource1;


This works for me.

Aurélio - Brazil

#9 Marc

Marc
  • Members
  • 62 posts

Posted 24 September 2007 - 10:51 PM

QUOTE (Aurelio - Brazil @ Sep 24 2007, 09:20 PM) <{POST_SNAPBACK}>
Hello Marc,
To resolve your problem, do it:

CODE
//Disconnect the grid
NextDBGrid1.DataSource := nil;

//Filter table
DataSet.Filter := 'any filter';
DataSet.Filtered := true;
DataSet.Refresh;

//Reconnect the grid
NextDBGrid1.DataSource := DataSource1;


This works for me.

Aurélio - Brazil


Ohhh, yes, great ! This works for me too ! Many thanks !

Marc

#10 Marc

Marc
  • Members
  • 62 posts

Posted 22 November 2007 - 02:01 AM

This bug isn't fixed SINCE 9TH SEPT.... and this workaround don't work with last release

SORRY, I THINK THAT I WILL SEARCH ANOTHER DBGRID. I CANNOT WAIT MORE LONGER AN HYPOTHETIC FIX !!!!!!!!!!!! mad.gif

#11 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 22 November 2007 - 02:25 AM

Hello Marc,

I didn't change anything for it in latest release. I don't know how this may be.

I am doing my best to solve every bug. It is not possible to solve them all in short time, specially such tricky bug as this one. Sometime it all looks like pushing a cat into a bag...

If you may, please use previous version until I see where is a problem.

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.

#12 stefanw

stefanw
  • Members
  • 32 posts

Posted 11 November 2012 - 09:14 PM

Hello Boki,

It seems I have the same problem with nextdbgrid version 5.4.2.
After filtering. the gridlines from the last records appear as empty rows (I set goGrid and ActiveRows). When I scroll in the dataset also outside the nextdbgrid, the filtered rows where mixed or disappear or appear at another row in the nextdbgrid. Some rows are empty or some data appears mutliple in the nextdbgrid.
The same behaviour as describe in this topics above.

Your workarounds are not function.

Do you have any tipps to workaround or setting some properties?

best regards
Stefan




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users