Topic: List filtered rows in Grid

Hello Dmitry,

I have an application where I am trying to perform my data maintenance (add, change and delete) all on one screen.  This makes it very quick to use which is an important requirement.
I have one main problem however. 
1.  All data rows are initially displayed corectly (picture1.jpg)
2.  A SQLSEARCH filter is applied to select a sub-set of data rows (picture2.jpg).  This also works correctly.
3.  I need to then makes changes to that sub-set of data rows.  But as soon as I click in the grid, the original full list is re-selected.
Is there a way to keep the sub-set of data rows until I have finished my changes and then re-select the full list? 
The way I was trying to write it was if there is a value in the SQLSEARCH field, then the grid displays the sub-set of data and if the value in the SQLSEARCH field is cleared, then the grid displays the full set of data.  But I have had no success.

Thanks,
Derek.

Post's attachments

Attachment icon companycars simplified.zip 903.03 kb, 487 downloads since 2015-11-04 

Re: List filtered rows in Grid

Hello,


I made some changes, please try it:

Post's attachments

Attachment icon companycars simplified_fixed.zip 51.67 kb, 508 downloads since 2015-11-05 

Dmitry.

Re: List filtered rows in Grid

Hi Dmitry,

Thanks for your help.  What I have also done is copy your extra code from the tablegrid_oncellclick procedure and added it to the tablegrid_onkeyup procedure and now the filtered list stays in place to allow me to work through it.  It's 100% working!

I have 2 other questions please. 
1.  My SQLQuery searches for values in ALL fields and works okay except with the MODEL.model field.  For example, if I enter 'Volkswagen' into my SQLQuery, 4 rows are found (PIC1.jpg) but if I enter 'Golf', nothing is found (PIC2.jpg).  Can you see if there is anything wrong with my query?

2.  I have 2 currency fields that are displayed in the basic grid correctly (right hand justified).  But when I use the SQLQuery, the result shows in the grid as left hand justified (PIC3.jpg).  Is this a bug or do I need to explicitly format currency fields in the SQLQuery itself?

Thanks again for you help,

Derek,

Post's attachments

Attachment icon companycars simplified_dmitry.zip 747.67 kb, 494 downloads since 2015-11-06 

4 (edited by tcoton 2015-11-06 13:58:29)

Re: List filtered rows in Grid

The SQL query executes properly in SQLStudio. For some reason, the very same query does not work in the project.

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=1441

Post's attachments

Attachment icon 2015-11-06_14-48-58.png 36.96 kb, 267 downloads since 2015-11-06 

Re: List filtered rows in Grid

Hi Tcoton,
Thanks for checking it out - I appreciate that.
I've tried changing the condition in the SQLQUERY a number of ways but it always comes back the same. 
I hope Dmitry can find out what the problem is.
Derek.

Re: List filtered rows in Grid

I guess it is a bug due to too many "OR" conditions. I tried the same query with different values and it always works in SQLStudio.

Did you try left join instead of searching in all tables at once?

Re: List filtered rows in Grid

Hi TCOTON,
I thought that when I first had the problem so tried it with just 2 conditions but it still didn't work.
And then I left outer joined instead - and still it didn't like it!  There is something wrong somewhere but I can't find it!
The only way I have got it to work is by using separate search fields for each column in the grid rather than using an SQLQUERY;  if I can't fix it, I may end up doing that on all the other columns as well, but it isn't quite the way I wanted it to be done.
Thanks again for your interest.
Derek.

8 (edited by tcoton 2015-11-09 09:21:05)

Re: List filtered rows in Grid

There is a typo on your line a ")" instead of a "}"

c.model like '%{edit9)%' or

big_smile

Re: List filtered rows in Grid

For cell justification, I would refer to this topic (one line per cell):

http://myvisualdatabase.com/forum/viewtopic.php?id=1789

Re: List filtered rows in Grid

Hi TCOTON,
Can't believe it - a typo! Great spot!   A new pair of glasses for me, I think.....
Thanks for the link to cell justification.  I'm reasonably okay with grid formatting - my original question was more to do with the inconsistency - why you don't need to explicitly format it when you're simply viewing the grid but you then need to format it as a result of using an SQLQUERY.
Thanks again,
Derek.

Re: List filtered rows in Grid

I am actually trying to do roughly the same "multisearch" from one textbox but without script as it should be with MVDB but it ends up with an error, please see screenshot. I am using version 2.1

It seems that the engine does not retrieve the textbox variable.

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=1469

Post's attachments

Attachment icon multisearch_issue.png 80.57 kb, 286 downloads since 2015-11-18 

Re: List filtered rows in Grid

tcoton
Not possible do multisearch without using script.

Dmitry.

Re: List filtered rows in Grid

Ok, any plan to implement this in a future release?

Re: List filtered rows in Grid

tcoton wrote:

Ok, any plan to implement this in a future release?

I can't answear right now, first need to decide, how to do it easy to use.

Dmitry.