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

Interrogating the FilterBar

Thread ID:

Created:

Updated:

Platform:

Replies:

90044 Sep 15,2009 09:23 AM UTC Sep 18,2009 01:33 PM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
Matthew Dudley
Asked On September 15, 2009 09:23 AM UTC

Hi all,

I understand that if I handle the QueryCellStyleInfo event of the GridGroupingControl I can access almost every "cell" within the grid, including the FilterBar. In my particular setup I have dropdown filters set for specific columns, and what I'd like to be able to do is query the selected value of these DropDownLists so that I can perform a database query based upon these values (instead of relying on the default filtering behaviour of the grid).

I'm having a tricky time finding where abouts I can access this information (assuming it is possible). I've been investigating the GridTableCellStyleInfoEventArgs parameter that is passed into the QueryCellStyleInfo event and have been looking specifically at the TableCellIdentify.FilterBarSummaryDescriptor property to see if I can ascertain the value of the filter dropdowns, but to no avail. Does anyone have an example of how this might be done?

If I'm going about this the wrong way, please let me know.

Kind regards,

Matt

Lingaraj S [Syncfusion]
Replied On September 18, 2009 01:33 PM UTC

Hi Matt,

Thank you for your interest in Syncfusion products.

If you want get a FilterBarCell selected value, then please try using TableControlCurrentCellCloseDropDown event in GridGroupingControl to achieve your behavior. Because only the DisplayText only is passed to GridGroupingControl.

Refer the code below:

Hashtable tab = new Hashtable();
// Form Load
this.gridGroupingControl1.TopLevelGroupOptions.ShowFilterBar = true;
this.gridGroupingControl1.TableDescriptor.Columns["Ship"].AllowFilter = true;
this.gridGroupingControl1.TableControlCurrentCellCloseDropDown += new GridTableControlPopupClosedEventHandler(gridGroupingControl1_TableControlCurrentCellCloseDropDown);
tab.Add("Ship", "");
// Event definition
void gridGroupingControl1_TableControlCurrentCellCloseDropDown(object sender, GridTableControlPopupClosedEventArgs e)
{
GridTableCellStyleInfo sty = e.TableControl.CurrentCell.Renderer.StyleInfo as GridTableCellStyleInfo;
if (sty.TableCellIdentity.TableCellType == GridTableCellType.FilterBarCell)
{
GridComboBoxCellRenderer ren = e.TableControl.CurrentCell.Renderer as GridComboBoxCellRenderer;
tab[sty.TableCellIdentity.Column.Name] = ren.ListBoxPart.SelectedItem;
}
}


Refer the sample from below link:
http://files.syncfusion.com/support/samples/Grid.Windows/7.3.0.20/Forums/GGCFilterValue.zip

Please let me know if you have any queries.

Regards,
Lingaraj S.

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

;