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. Image for the cookie policy date
close icon

How to detect the validation of a filter with GridOffice2007Filter?

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.

3 Replies

JJ Jisha Joy Syncfusion Team August 11, 2010 08:56 AM UTC

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


RA Raphael August 11, 2010 12:16 PM UTC

Hi!

Thank you very much, it works!

Have a nice day.

Sincerely,

Raphaël.


JJ Jisha Joy Syncfusion Team August 12, 2010 04:04 AM UTC

Hi Raphaël,

Thank you for your update.

Regards,
Jisha

Loader.
Live Chat Icon For mobile
Up arrow icon