Jump to content


Photo

Filtering a boolean column


  • Please log in to reply
4 replies to this topic

#1 Delphier

Delphier
  • Members
  • 10 posts

Posted 05 July 2016 - 03:56 PM

I can figure out how to filter a Boolean column. I'd like to be able to show:

 

 o all rows in the grid; or

 o only rows where the Boolean cell's value is false.

 

This is what I have tried:

 

var
  col: TNxTextColumn6;
begin
  col := TNxTextColumn6(ngMain.Columns[7]);
  col.Filter := false.ToString();
  col.FilterEnabled := true;
end;
 

 

Can you point me in the right direction, please?

 

Thank you



#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 05 July 2016 - 04:17 PM

Hi,

Maybe you can try something like:

  NxTextColumn61.Filter := BoolToStr(False, True);
  NxTextColumn61.FilterEnabled := True;
This Bool to String routines are sometimes tricky.
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 Delphier

Delphier
  • Members
  • 10 posts

Posted 05 July 2016 - 05:32 PM

Arrgh!  I mis-spoke (and mis-typed).

 

When I said a Boolean column I meant to say a Checkbox column.

 

Is it possible?

 

Thank you for your help,



#4 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 12 July 2016 - 01:08 PM

Hi,

Checkbox doesn't have Filter property (like Text column). But I can add it. I think that it's not hard.
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 Boki (Berg)

Boki (Berg)

    Boki (Berg)

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

Posted 13 July 2016 - 07:36 PM

Hi,

I have added Filter property to NxCheckBoxColumn6. You can write things like

True
False,True
!True

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users