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


Thread ID:





71622 Feb 7,2008 04:47 PM UTC Apr 9,2008 05:46 PM UTC WinForms 3
Tags: GridControl
Stephane Dapsanse
Asked On February 7, 2008 04:47 PM UTC


I have an urgent request about a specialization of the GridFilterBar.
I was given some code by Syncfusion to handle private keys in the FilterBar. The specialization overrides GetFilterFromRow to swap the display string with the actual value (an ID) needed by the FilterBar.
For the current column, the values are retrieved using:
s = "'" + cc.Renderer.ControlText + "'";
s1 = "'" + cc.Renderer.ControlValue.ToString() + "'";

For the other option previously selected, the code is:
s = "'" + grid[row, col].GetFormattedText(grid[row, col].CellValue);
s1 = "'" + grid[row, col].CellValue.ToString() + "'";
But this code is not working.
I can retrieve the value displayed with:
s = "'" + grid[row, col].CellValue.ToString() + "'";
But I don't know how to retrieve the value needed by the filter. Something like:
s1 = "'" + grid[row, col].Cell.Renderer.ControlValue.ToString() + "'";
similar to the way it works for the current column.

This is an urgent request. A quick answer will be highly appreciated.

haneefm [Syncfusion]
Replied On February 7, 2008 11:13 PM UTC

Hi Stephane,

Please refer to the following sample that works fine with this code in filtering by the displaymember. This should work if you choose a value from combobox. In this sample we replace the selected value (DisplayMember) with Valuemember and apply the filter to the underlying Datatable. Check the GetFilterFromRow() code in the sample for more details.


Let me know if this helps.


Stephane Dapsanse
Replied On February 7, 2008 11:30 PM UTC

Hi Rajagopal,

Your example has the same issue I have (I am using the exact same code).

if(cc.ColIndex == col)
s = "'" + cc.Renderer.ControlText + "'";
s1 = "'" + cc.Renderer.ControlValue.ToString() + "'";
s = "'" + grid[row, col].GetFormattedText(grid[row, col].CellValue);
s1 = "'" + grid[row, col].CellValue.ToString() + "'";

filter = filter.Replace(s, s1);

Your example never reaches the else-block because there is only one column with a foreign key in your example.
But the statements in your else-block are actually not working.
s is the displayed value: this can be retrieved with s = "'" + grid[row, col].CellValue.ToString() + "'";
s1 is the id that should replace the displayed value: this is the value I don't know how to retrieve

By the way, the if-block works just fine, but only for the current cell. I want the exact same behaviour but for a cell of column col and a row = filter's row.


haneefm [Syncfusion]
Replied On April 9, 2008 05:46 PM UTC

Hi Stephane,

Thank you for your update.

I am not sure of what be might be causing this strange behavior without a working sample. I have tested this issue in the attached sample with Essentail studio V.4.x/5.x. But i was not able to reproduce the issue. Is it possible for you to upload us a minimal sample or modify the browser sample to reproduce the issue here? This will help us to analyse the issue further.

Sample : ModifiedFilterBarDisplayMember.zip

Thanks for using Syncfusion product.

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