How to detect the validation of a filter with GridOffice2007Filter?
3 Replies
SIGN IN To post a reply.
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);
}