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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Access drop down Values in a Filter bar combox box

Thread ID:





72167 Mar 6,2008 04:22 AM UTC Mar 25,2008 08:21 PM UTC WinForms 2
Tags: GridControl
Jasper Tam
Asked On March 6, 2008 04:22 AM UTC


I cannot directly using filter bar for filtering the rows since there are more complex filter requirements. Instead I would like to access the dropdown list values of it.

do you know any ways to do it as it would be quite big effort to access the whole grid and extract the distinct values of a column?

Administrator [Syncfusion]
Replied On March 17, 2008 03:06 PM UTC

Hi Jasper,

We are working on the forum.. We will update you soon.

Administrator [Syncfusion]
Replied On March 25, 2008 08:21 PM UTC

Hi Jasper,

The below method is called to generate dataTable of unique choices for a FilterBar entry. The method inserts (none) and (custom) as the first two entries in the list. The other entries are unique occurrences of entries from the specified column. The (none) and (custom) strings can be changed through "GridFilterBarStrings".

Argument :
The "dv" DataView that is being displayed in the grid.
The "colName" column name of the column whose FilterBar choices are being contructed.

protected virtual DataTable CreateUniqueEntries(DataView dv, string colName)
DataTable dt = new DataTable(colName);
dt.Columns.Add(new DataColumn(colName));

DataRow dr;
if(GridFilterBarStrings[_none_].Length > 0)
dr = dt.NewRow();
dr[0] = GridFilterBarStrings[_none_];

if(GridFilterBarStrings[_custom_].Length > 0)
dr = dt.NewRow();
dr[0] = GridFilterBarStrings[_custom_];
string s = "";
for(int i = 0; i < dv.Count; ++i)
if(s != dv[i].Row[colName].ToString())
s = dv[i].Row[colName].ToString();
dr = dt.NewRow();
dr[0] = s;
return dt;

Best regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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