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.
Unfortunately, activation email could not send to your email. Please try again.

How to detect the validation of a filter with GridOffice2007Filter?

Thread ID:

Created:

Updated:

Platform:

Replies:

95929 Aug 10,2010 11:43 AM Aug 12,2010 12:04 AM Windows Forms 3
loading
Tags: GridControl
Raphael
Asked On August 10, 2010 11:43 AM

Hello,

I am working with a GridGroupingControl and a GridOffice2007Filter.

The filter is associated to the grid, so I have a red icon at corner bottom right of ColHeaders.

Because my GridGroupingControl is large, I would like the user can visually know the ColHeaders which he filtered.

That is why I would like to detect when the button "OK" in my GridOffice2007Filter is pressed, in order to change the backcolor of the ColHeader of the column filtered.

Could you help me please?

Thanks in advance for your future response.

Sincerely,

Raphaël.

Jisha Joy [Syncfusion]
Replied On August 11, 2010 04:56 AM

Hi Raphael,

You could achieve the desired behavior by handling the RecordFilters.Changed and TableControlPrepareViewStyleInfo events.



this.gridGroupingControl1.TableDescriptor.RecordFilters.Changed += new Syncfusion.Collections.ListPropertyChangedEventHandler(RecordFilters_Changed);
this.gridGroupingControl1.TableControlPrepareViewStyleInfo += new GridTableControlPrepareViewStyleInfoEventHandler(gridGroupingControl1_TableControlPrepareViewStyleInfo);


void gridGroupingControl1_TableControlPrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;
if (style.TableCellIdentity.Column != null && ht.Contains(style.TableCellIdentity.Column.Name)
&& (style.TableCellIdentity.TableCellType == GridTableCellType.ColumnHeaderCell ))
{
e.Inner.Style.Themed = false;
e.Inner.Style.BackColor = Color.Red;
}

}
Hashtable ht = new Hashtable();
void RecordFilters_Changed(object sender, Syncfusion.Collections.ListPropertyChangedEventArgs e)
{

RecordFilterDescriptor dex = e.Item as RecordFilterDescriptor;
ht.Add(dex.FieldDescriptor.Name, dex.FieldDescriptor.Name);


}


Regards,
Jisha

Raphael
Replied On August 11, 2010 08:16 AM

Hi!

Thank you very much, it works!

Have a nice day.

Sincerely,

Raphaël.

Jisha Joy [Syncfusion]
Replied On August 12, 2010 12:04 AM

Hi Raphaël,

Thank you for your update.

Regards,
Jisha

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.

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.

;