Jump to content


Photo

Filter Line


  • Please log in to reply
12 replies to this topic

#1 manfred

manfred
  • Members
  • 6 posts

Posted 19 November 2007 - 08:48 PM

Hi

Is there a way to have a "Filter-Bar " on top of the Grid?
Something like this: ( ScreenShot ist in the Attachment ) unsure.gif

Thanks for Your Feedback
Manfred

Attached Files

  • Attached File  tmp.jpg   11.46KB   5 downloads


#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 19 November 2007 - 08:52 PM

Hello Manfred,

Unfortunatelly not at the moment.

I have planned to add button with arrow on headers and then open drop-down meny with Filter EditBox and some options, but this will take some time.

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 manfred

manfred
  • Members
  • 6 posts

Posted 19 November 2007 - 09:04 PM

Thanks for your fast Replay.

Shalom
Manfred

#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 19 November 2007 - 09:08 PM

Hello Manfred,

I think that even now, maybe something may be done with Input Line.

But filtering need to be done manually with standard DataSet.Filter property. If you are interested, maybe we can investigate this possibility.

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 manfred

manfred
  • Members
  • 6 posts

Posted 20 November 2007 - 01:10 AM

Hi again

But filtering need to be done manually with standard DataSet.Filter property. If you are interested, maybe we can investigate this possibility.


Yes i am interested. rolleyes.gif
I need a Unicode DB Grid with Filter. Until now i used a Free-Component and then i found out it wasent Unicode
so i tried to find a own solution:
DB Grid wit normal Edit-Fields on top, but this dont look so perfekt.

Shalom
Manfred

#6 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 20 November 2007 - 01:12 AM

Hello Manfred,

I will work on this sample durring tomorow. I hope that I will be able to do this.

InputLine is used for adding new row into grid, but if it is not needed, maybe can be used as Filter Line.

I am not yet 100% sure that this will success, but I will know more details tomorow.

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.

#7 manfred

manfred
  • Members
  • 6 posts

Posted 20 November 2007 - 01:43 AM

Hi

QUOTE
InputLine is used for adding new row into grid, but if it is not needed, maybe can be used as Filter Line.

The "adding new row" is not neded. ( In my Case cool.gif )

QUOTE
I am not yet 100% sure that this will success, but I will know more details tomorow.


Thanks for trying.

Shalom
Manfred

#8 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 20 November 2007 - 10:04 PM

Hello Manfred,

Please look in attach for one small example of Filtering (ClientDataSet, but I assume that it is same with other DataSets):

There is a only one event added:

CODE
procedure TForm1.NextDBGrid1InputAccept(Sender: TObject;
  var Accept: Boolean);
var
  FilterStr: WideString;
begin
  Accept := False;
  FilterStr := NextDBGrid1.Columns[1].InputValue;
  if FilterStr <> '' then
  begin
    ClientDataSet1.Filter := 'Upper(Project) LIKE ' + QuotedStr('%' + UpperCase(FilterStr) + '%');
    ClientDataSet1.Filtered := True;
  end else ClientDataSet1.Filtered := False;
end;


This event occur, when new row need to be added from InputLine. With setting Accept := False, new row will be never added.

Please note that in this demo I have only add filtering for Project filed, but easily may be done for all other fields.

Best regards

Attached Files


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.

#9 manfred

manfred
  • Members
  • 6 posts

Posted 21 November 2007 - 12:47 PM

Hi

this look like what i was searching!! laugh.gif
Does this also work with Unicode? ( Unicode search )

Manfred

#10 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 21 November 2007 - 03:06 PM

Hello Manfred,

I am not sure, because Filter property of DataSet is of string type sad.gif

InputValue property of Column is WideString.

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.

#11 manfred

manfred
  • Members
  • 6 posts

Posted 30 November 2007 - 12:30 PM

Hi

is there a Demoversion of the NextDBGrid?

Manfred

#12 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 30 November 2007 - 03:45 PM

Hello Manfred,

Unfortunatelly not at this moment.

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.

#13 rootless

rootless
  • Members
  • 2 posts

Posted 09 September 2009 - 09:49 AM

QUOTE (Boki (Berg) @ Nov 20 2007, 10:04 PM) <{POST_SNAPBACK}>
Hello Manfred,

Please look in attach for one small example of Filtering (ClientDataSet, but I assume that it is same with other DataSets):

There is a only one event added:

CODE
procedure TForm1.NextDBGrid1InputAccept(Sender: TObject;
  var Accept: Boolean);
var
  FilterStr: WideString;
begin
  Accept := False;
  FilterStr := NextDBGrid1.Columns[1].InputValue;
  if FilterStr <> '' then
  begin
    ClientDataSet1.Filter := 'Upper(Project) LIKE ' + QuotedStr('%' + UpperCase(FilterStr) + '%');
    ClientDataSet1.Filtered := True;
  end else ClientDataSet1.Filtered := False;
end;


This event occur, when new row need to be added from InputLine. With setting Accept := False, new row will be never added.

Please note that in this demo I have only add filtering for Project filed, but easily may be done for all other fields.

Best regards

PLS reload file




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users