We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

AND Filter in the grid filter bar.

Thread ID:

Created:

Updated:

Platform:

Replies:

71462 Jan 31,2008 05:54 PM UTC Feb 7,2008 01:32 AM UTC WinForms 4
loading
Tags: GridControl
Digant
Asked On January 31, 2008 05:54 PM UTC

How do I write an AND filter on the Syncfusion Grid filter bar?

I have tried the following, but they did not work:

1) (>10) && (<1000)
2) (>10) AND (<1000)

Basically I am trying to specifiy a range filter, where I can see the rows where the specific column value is between 10 and 1000.
Please advise.
Thanks for your help.



Sri Rajan [Syncfusion]
Replied On January 31, 2008 10:56 PM UTC

Hi Digant,

Thank you for your continued interest in Syncfusion products.

Please refer to the attached sample, that will show you how to specifiy a range filter(between 10 to 10000)
http://websamples.syncfusion.com/samples/Grid.Windows/F71462/main.htm

Please let me know if this helps.

Regards,
Srirajan



Digant
Replied On February 1, 2008 02:21 PM UTC

Hi Srirajan,
Thank you for your reply.
However, we are trying to apply the below mentioned filter in the grid, not through the source code.
That is, we would want to open up the filter bar on the grid and type in a filter string there.

Please advise.
Thanks again for your help.

>Hi Digant,

Thank you for your continued interest in Syncfusion products.

Please refer to the attached sample, that will show you how to specifiy a range filter(between 10 to 10000)
http://websamples.syncfusion.com/samples/Grid.Windows/F71462/main.htm

Please let me know if this helps.

Regards,
Srirajan





Digant
Replied On February 5, 2008 06:01 PM UTC

Any updates on the below?
Please advise.
Thanks.

>Hi Srirajan,
Thank you for your reply.
However, we are trying to apply the below mentioned filter in the grid, not through the source code.
That is, we would want to open up the filter bar on the grid and type in a filter string there.

Please advise.
Thanks again for your help.

>Hi Digant,

Thank you for your continued interest in Syncfusion products.

Please refer to the attached sample, that will show you how to specifiy a range filter(between 10 to 10000)
http://websamples.syncfusion.com/samples/Grid.Windows/F71462/main.htm

Please let me know if this helps.

Regards,
Srirajan







Sri Rajan [Syncfusion]
Replied On February 7, 2008 01:32 AM UTC

Hi Digant,

Thank your for your continued interest in Syncfusion products.

Currently there is no inbuild support available to open up the filter bar on the grid and type in a filter string there. but we can achieve this through code by inherit the GridFilterBar. Please refer to the below code that shows how to apply the below mentioned filter in the grid.


private string BuildFilterString()
{
GridCurrentCell cc = _grid.CurrentCell;
string s;
string filter = "";
string s1, s2;
for(int i = 1; i <= _grid.Model.ColCount; ++i)
{
if(i == cc.ColIndex)
s = cc.Renderer.ControlText;
else
s = _grid[cc.RowIndex, i].Text;
if(s.Length > 0)
{
string gridMappingName = _grid.Binder.InternalColumns[_grid.Binder.ColIndexToField(i)].MappingName;
if (gridMappingName == "Rate")
{
if (s.Length > 2 && Convert.ToBoolean(s.IndexOf('-')) && s.IndexOf('-') != s.Length - 1)
{
s1 = s.Substring(0, s.IndexOf('-'));
s2 = s.Substring(s.IndexOf('-') + 1, s.Length - s.IndexOf("-") - 1);
filter = filter.Replace("AND", "AND [{0}] ");
filter = filter + string.Format("[{0}]>" + s1 + " AND [{0}]<" + s2, gridMappingName, s);
}
}
}
}
return filter;
}


Please refer to the attached sample for more details.
Sample

Note:
*In this sample Criteria should be in this format Value1-Value2
Example: 10-20

Please let me know if this helps.

Regards,
Srirajan




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;