CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Showing filtered rows in a data grid

  1. #1
    Join Date
    Feb 2003
    Location
    Germany
    Posts
    89

    Showing filtered rows in a data grid

    Hi,

    I have a DataTable(paceTime), a DataGrid(paceTimeGrid) and a Binding(paceTimeBinding).
    The grid is load via ReadXml; this works, all rows are displayed.
    Now, I want to apply a filter on the grid and show only filtered rows.

    Code:
    ..      
    // just a snippet from *.designer.cs:
                this.paceTimeGrid.DataSource = this.paceTimeBinding;
                this.paceTimeBinding.DataSource = typeof(PaceTimeDataTable);
    ...    
    // applying the filter:
                string FName ="Hugo";
                string FString = string.Format("Name = '{0:}'",FName);
                paceTimeBinding.Filter = FString;
    
    // whats next?
    How can I repaint the grid, displaying only filtered rows? Is there something like Invalidate, or do I have to Select the matching rows and rebuild the grid?


    I'm using VS2008 and .Net 4.

    Thanx f.y.h.
    prepare that the light at the end of your tunnel is just a freight train coming your way - metallica

  2. #2
    Join Date
    Jul 2011
    Posts
    9

    Re: Showing filtered rows in a data grid

    Hi,

    You are doing great practice. I don't know how to complete this by ordinary .net components. I came to know about a component which can complete your requirement of repaint the grid and display only filtered rows. Here is the example http://www.******.com/Feature.aspx?id=custom_painting

    May be helpful.

  3. #3
    Join Date
    Oct 2004
    Location
    Rocket City
    Posts
    220

    Re: Showing filtered rows in a data grid


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)