|
-
December 29th, 2010, 06:07 AM
#1
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
-
July 23rd, 2011, 06:10 AM
#2
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.
-
July 25th, 2011, 10:54 AM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|