in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Filter

Last post 01-03-2008 7:23 PM by brent.podruzny. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 11-06-2003 10:48 AM

    Filter


    Hi

    I am looking to find a way of filtering products that I have retrieved.

    I am working with a flexgrid at the moment but have looked at the true DB grid also. The filterbar on it is very useful and would like a way of performing the same on a flexgrid.

    I could just re-retrieve the data using a parameterised stored procedure (SQL2000) but that seems like overkill.

    Also, I’m not exactly sure of the advantages/disadvantages of using 1 or the other (flexgrid/trueDBgrid), maybe someone could enlighten me or point me in the direction of a URL.

    Thanks in advance

    Nickie

    Click here to view the original newsgroup article (read only).

  • 11-06-2003 10:50 AM In reply to

    Re: Filter


    Re- below, I am using vb.net.

    "Nickie Bryson" wrote:
    >
    >Hi
    >
    >I am looking to find a way of filtering products that I have retrieved.
    >
    >I am working with a flexgrid at the moment but have looked at the true DB grid also. The filterbar on it is very useful and would like a way of performing the same on a flexgrid.
    >
    >I could just re-retrieve the data using a parameterised stored procedure (SQL2000) but that seems like overkill.
    >
    >Also, I’m not exactly sure of the advantages/disadvantages of using 1 or the other (flexgrid/trueDBgrid), maybe someone could enlighten me or point me in the direction of a URL.
    >
    >Thanks in advance
    >
    >Nickie
    >

    Click here to view the original newsgroup article (read only).

  • 11-09-2003 10:24 AM In reply to

    Re: Filter

    Hi Nickie.

    We have a sample that implements a filter row for the FlexGrid. You can use
    it as-is or customize to fit your needs.

    The sample is called "FilterRow" and you can get it from our samples page at
    http://www.componentone.com/pages.aspx?pagesid=113.

    PS: Another user, Glenn Wildon, just posted an improved version of the
    filter bar code. I will update our sample to use Glenn's improvements in the
    next couple of days. Thanks Glenn.



    "Nickie Bryson" wrote in message
    news:3faa6da9$1@vger5.componentone.com...
    >
    > Re- below, I am using vb.net.
    >
    > "Nickie Bryson" wrote:
    > >
    > >Hi
    > >
    > >I am looking to find a way of filtering products that I have retrieved.
    > >
    > >I am working with a flexgrid at the moment but have looked at the true DB
    grid also. The filterbar on it is very useful and would like a way of
    performing the same on a flexgrid.
    > >
    > >I could just re-retrieve the data using a parameterised stored procedure
    (SQL2000) but that seems like overkill.
    > >
    > >Also, I'm not exactly sure of the advantages/disadvantages of using 1 or
    the other (flexgrid/trueDBgrid), maybe someone could enlighten me or point
    me in the direction of a URL.
    > >
    > >Thanks in advance
    > >
    > >Nickie
    > >
    >


    Click here to view the original newsgroup article (read only).

  • 11-10-2003 6:17 AM In reply to

    Re: Filter


    Hi

    I have d/l the sample under 'FlexGroup' and it looks like what I am looking for. Although I am unable to run the sample due to the following error :-
    'A first chance exception of type 'System.DllNotFoundException' occurred in c1.win.c1flexgrid.dll

    Additional information: Unable to load DLL (UxTheme.dll).'


    On this line of code
    _flex = New C1FlexGrid()

    Any Ideas?

    Thanks for your time.

    Nickie



    "Bernardo" wrote:
    >Hi Nickie.
    >
    >We have a sample that implements a filter row for the FlexGrid. You can use
    >it as-is or customize to fit your needs.
    >
    >The sample is called "FilterRow" and you can get it from our samples page at
    >http://www.componentone.com/pages.aspx?pagesid=113.
    >
    >PS: Another user, Glenn Wildon, just posted an improved version of the
    >filter bar code. I will update our sample to use Glenn's improvements in the
    >next couple of days. Thanks Glenn.
    >
    >
    >
    >"Nickie Bryson" wrote in message
    >news:3faa6da9$1@vger5.componentone.com...
    >>
    >> Re- below, I am using vb.net.
    >>
    >> "Nickie Bryson" wrote:
    >> >
    >> >Hi
    >> >
    >> >I am looking to find a way of filtering products that I have retrieved.
    >> >
    >> >I am working with a flexgrid at the moment but have looked at the true DB
    >grid also. The filterbar on it is very useful and would like a way of
    >performing the same on a flexgrid.
    >> >
    >> >I could just re-retrieve the data using a parameterised stored procedure
    >(SQL2000) but that seems like overkill.
    >> >
    >> >Also, I'm not exactly sure of the advantages/disadvantages of using 1 or
    >the other (flexgrid/trueDBgrid), maybe someone could enlighten me or point
    >me in the direction of a URL.
    >> >
    >> >Thanks in advance
    >> >
    >> >Nickie
    >> >
    >>
    >
    >

    Click here to view the original newsgroup article (read only).

  • 11-10-2003 8:40 AM In reply to

    Re: Filter


    Hi Bernardo

    I used the filterrow class from 'FlexGroup' sample and added it to my project and it works a treat. Thanks for your help.

    Nickie

    "Nickie Bryson" wrote:
    >
    >Hi
    >
    >I have d/l the sample under 'FlexGroup' and it looks like what I am looking for. Although I am unable to run the sample due to the following error :-
    >'A first chance exception of type 'System.DllNotFoundException' occurred in c1.win.c1flexgrid.dll
    >
    >Additional information: Unable to load DLL (UxTheme.dll).'
    >
    >
    >On this line of code
    >_flex = New C1FlexGrid()
    >
    >Any Ideas?
    >
    >Thanks for your time.
    >
    >Nickie
    >
    >
    >
    >"Bernardo" wrote:
    >>Hi Nickie.
    >>
    >>We have a sample that implements a filter row for the FlexGrid. You can use
    >>it as-is or customize to fit your needs.
    >>
    >>The sample is called "FilterRow" and you can get it from our samples page at
    >>http://www.componentone.com/pages.aspx?pagesid=113.
    >>
    >>PS: Another user, Glenn Wildon, just posted an improved version of the
    >>filter bar code. I will update our sample to use Glenn's improvements in the
    >>next couple of days. Thanks Glenn.
    >>
    >>
    >>
    >>"Nickie Bryson" wrote in message
    >>news:3faa6da9$1@vger5.componentone.com...
    >>>
    >>> Re- below, I am using vb.net.
    >>>
    >>> "Nickie Bryson" wrote:
    >>> >
    >>> >Hi
    >>> >
    >>> >I am looking to find a way of filtering products that I have retrieved.
    >>> >
    >>> >I am working with a flexgrid at the moment but have looked at the true DB
    >>grid also. The filterbar on it is very useful and would like a way of
    >>performing the same on a flexgrid.
    >>> >
    >>> >I could just re-retrieve the data using a parameterised stored procedure
    >>(SQL2000) but that seems like overkill.
    >>> >
    >>> >Also, I'm not exactly sure of the advantages/disadvantages of using 1 or
    >>the other (flexgrid/trueDBgrid), maybe someone could enlighten me or point
    >>me in the direction of a URL.
    >>> >
    >>> >Thanks in advance
    >>> >
    >>> >Nickie
    >>> >
    >>>
    >>
    >>
    >

    Click here to view the original newsgroup article (read only).

  • 01-02-2008 3:21 PM In reply to

    Re: Filter

    Hi, I am trying to use this sample as well.  I would like the filter to work as I type but it inly seems to work when I hit tab to move to a different cell.  I have tried to get the keypressedit event implemented in the FilterRow class but I cannot seem to get it working properly, especially when I try to hit backspace 

    This is what I added to the FilterRow class

    void _flex_KeyPressEdit(object sender, KeyPressEditEventArgs e)
            {
                if (e.Row == _flex.Rows.Fixed - 1)
                {
                    e.Handled = true;
                    _flex.Editor.Text = _flex.Editor.Text + e.KeyChar; //this is buggy if I kit backspace key
                    _flex.FinishEditing();
                    UpdateFilter();
                }
                else e.Handled = false;
            }
     

    Any help would be appreciated 

  • 01-02-2008 6:07 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 527

    Re: Filter

    You could catch the backspace key separately and handle it as such (using your code above)

    1. if (e.Row == _flex.Rows.Fixed - 1 & e.KeyChar != (char)8) {
    2.         e.Handled = true;
    3.         _flex.Editor.Text = _flex.Editor.Text + e.KeyChar;
    4.         _flex.FinishEditing();
    5.         UpdateFilter();
    6.     }
    7.     else if (e.KeyChar == (char)8 & _flex.Editor.Text.Length > 0) {
    8.         e.Handled = true;
    9.         _flex.Editor.Text = _flex.Editor.Text.Substring(0, _flex.Editor.Text.Length - 1);
    10.         _flex.FinishEditing();
    11.         UpdateFilter();
    12.     }
    13.     else {
    14.         e.Handled = false;
    15.     }

    Regards,
    Greg L

    ComponentOne Technical Engagement
    Filed under: ,
  • 01-03-2008 11:42 AM In reply to

    Re: Filter

    Great!  Thanks.

    One more thing.  I have looked at the OwnerDrawCell examples but can't get it to work correctly.  What I want to do is draw a thick border around the FilterRow with thinner lines between the columns.  Just like in the CellBorders sample.  I looked at that sample but can't seem to get it to work on the FilterRow.

  • 01-03-2008 2:45 PM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 527

    Re: Filter

    Here's the OwnerDrawCell code from that sample somewhat simplified since you can assume exactly where the filter row is

    1.  if (e.Row == _flex.Rows.Fixed - 1) {
    2.         //draw cell content as usual
    3.         e.DrawCell();
    4.        
    5.         //get custom border widths for this cell
    6.         Printing.Margins m;
    7.         int outer = 3;
    8.         int inner = 1;
    9.        
    10.         if (e.Col == 0) {
    11.             m = new Printing.Margins(outer, inner, outer, outer);
    12.         }
    13.         else if (e.Col == _flex.Cols.Count - 1) {
    14.             m = new Printing.Margins(inner, outer, outer, outer);
    15.         }
    16.         else {
    17.             m = new Printing.Margins(inner, inner, outer, outer);
    18.         }
    19.        
    20.         //draw custom borders
    21.         Rectangle rc;
    22.         Graphics g = e.Graphics;
    23.         if (m.Top > 0) {
    24.             rc = e.Bounds;
    25.             rc.Height = m.Top;
    26.             g.FillRectangle(Brushes.Blue, rc);
    27.         }
    28.        
    29.         if (m.Left > 0) {
    30.             rc = e.Bounds;
    31.             rc.Width = m.Left;
    32.             g.FillRectangle(Brushes.Blue, rc);
    33.         }
    34.        
    35.         if (m.Bottom > 0) {
    36.             rc = e.Bounds;
    37.             rc.Y = rc.Bottom - m.Bottom;
    38.             rc.Height = m.Bottom;
    39.             g.FillRectangle(Brushes.Blue, rc);
    40.         }
    41.        
    42.         if (m.Right > 0) {
    43.             rc = e.Bounds;
    44.             rc.X = rc.Right - m.Right;
    45.             rc.Width = m.Right;
    46.             g.FillRectangle(Brushes.Blue, rc);
    47.         }
    48.        
    49.     }

    Here 1 is the thinner inside thickness and 3 is the outer.  For even thinner you can set it to 0, but then change _style.Border.Direction to "both" above in the FilterRow.cs file.

    regards,
    Greg

    ComponentOne Technical Engagement
  • 01-03-2008 7:23 PM In reply to

    Re: Filter

    Thanks Greg! 

Page 1 of 1 (10 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.