Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.NET Framework 2.0 For discussion of the Microsoft .NET Framework 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 2.0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 24th, 2016, 07:21 PM
Registered User
Points: 10, Level: 1
Points: 10, Level: 1 Points: 10, Level: 1 Points: 10, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2016
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Data filtering

how can I create the filter itself and to set filtering conditions using already described IFilter interface. I am using Dapfor .Net grid.
Reply With Quote
  #2 (permalink)  
Old May 24th, 2016, 07:28 PM
Registered User
Points: 6, Level: 1
Points: 6, Level: 1 Points: 6, Level: 1 Points: 6, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2016
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by maplecutie View Post
how can I create the filter itself and to set filtering conditions using already described IFilter interface. I am using Dapfor .Net grid.
//User control for editing a filter.
public partial class CustomFilterControl : UserControl
{
private IWindowsFormsEditorService _service;
private CustomFilter _filterEditor;
private IFilter _currentFilter;

public CustomFilterControl()
{
InitializeComponent();
}

public IFilter CurrentFilter
{
get { return _currentFilter; }
}

public void EditFilter(IWindowsFormsEditorService service, CustomFilter filterEditor)
{
if (service != null)
{
//Display the control
_filterEditor = filterEditor;
_service = service;
service.DropDownControl(this);
}
}

//Called when the user clicks on the 'Ok' button
private void buttonOk_Click(object sender, EventArgs e)
{
if (_service != null)
{
//Create a filter and keep it in the _currentFilter variable
double minValue = (double)minValueCtrl.Value;
double maxValue = (double)maxValueCtrl.Value;
_currentFilter = new Ui.Filter(delegate(Row row)
{
double price = (double) row["Price"].Value;
if (minValue > 0 && price < minValue)
{
//filter the row, if the value less than the minValue.
return true;
}
if (maxValue > 0 && price > maxValue)
{
//filter the row, if the value less than the minValue.
return true;
}
return false;
});

//Close the dropdown control
_service.CloseDropDown();
}
}
}
Reply With Quote
The Following User Says Thank You to sobort84 For This Useful Post:
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filtering data Erik Severiens BOOK: Beginning ASP.NET 4 : in C# and VB 6 June 6th, 2013 11:21 AM
Filtering XML data aldwinenriquez XSLT 7 August 25th, 2008 03:24 AM
Filtering Data after its been cached Durkee VB.NET 2002/2003 Basics 0 November 13th, 2007 04:57 PM
data filtering from combobox MAKO C# 4 June 1st, 2006 03:54 AM
Need Help on Filtering duplicated data fanyin XSLT 2 November 4th, 2004 07:06 PM



All times are GMT -4. The time now is 12:06 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.