'宣言 Public Property FilterCellAppearanceActive As Infragistics.Win.AppearanceBase
public Infragistics.Win.AppearanceBase FilterCellAppearanceActive {get; set;}
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid #Region "UltraGrid1_InitializeLayout" Private Sub UltraGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout ' Appearance of the filter row can be controlled using the FilterRowAppearance proeprty. e.Layout.Override.FilterRowAppearance.BackColor = Color.LightYellow ' Appearance of the row selector of the filter row can be controlled using the ' FilterRowSelectorAppearance property. e.Layout.Override.FilterRowSelectorAppearance.Image = Nothing ' FilterRowAppearanceActive applies to the filter row when the filter row has some ' filter criteria. Likewise with the FilterCellAppearanceActive. It gets applied to ' the filter cell that currently contains some filter criteria. e.Layout.Override.FilterRowAppearanceActive.BackColor = Color.LightBlue e.Layout.Override.FilterCellAppearanceActive.ForeColor = Color.Red ' Appearance of the filter cells can be controlled using the FilterCellAppearance ' property. FilterCellAppearance property is also exposed off the column so the ' filter cell appearance can be controlled on a per column basis. e.Layout.Override.FilterCellAppearance.ForeColor = Color.Blue e.Layout.Bands(0).Columns(0).FilterCellAppearance.ForeColor = Color.Maroon ' You can use the FilterRowPrompt to display a prompt in the filter row. By default ' UltraGrid does not display any prompt in the filter row. e.Layout.Override.FilterRowPrompt = "Click here to filter data..." ' You can use the FilterRowPromptAppearance to change the appearance of the prompt. ' By default the prompt is transparent and uses the same fore color as the filter row. ' You can make it non-transparent by setting the appearance' BackColorAlpha property ' or by setting the BackColor to a desired value. e.Layout.Override.FilterRowPromptAppearance.BackColorAlpha = Alpha.Opaque ' You can use the FilterOperatorAppearance to change the appearance of the filter ' operator ui if it's visible. This property is exposed off the column as well. e.Layout.Override.FilterOperatorAppearance.ForeColor = Color.Blue e.Layout.Bands(0).Columns(0).FilterOperatorAppearance.ForeColor = Color.Maroon ' Border style of the filter cells can be controlled using the BorderStyleFilterCell ' property. e.Layout.Override.BorderStyleFilterCell = UIElementBorderStyle.Solid ' BorderStyleFilterRow property controls the border style of the filter row. e.Layout.Override.BorderStyleFilterRow = UIElementBorderStyle.Solid ' BorderStyleFilterOperator controls the border style of the filter operator ui if ' it's visible. e.Layout.Override.BorderStyleFilterOperator = UIElementBorderStyle.Dotted ' By default the prompt is spread across multiple cells if it's bigger than the ' first cell. You can confine the prompt to a particular cell by setting the ' SpecialRowPromptField property off the band to the key of a column. e.Layout.Bands(0).SpecialRowPromptField = e.Layout.Bands(0).Columns(0).Key ' Display a separator between the filter row other rows. SpecialRowSeparator property ' can be used to display separators between various 'special' rows, including for the ' filter row. This property is a flagged enum property so it can take multiple values. e.Layout.Override.SpecialRowSeparator = SpecialRowSeparator.FilterRow ' You can control the appearance of the separator using the SpecialRowSeparatorAppearance ' property. e.Layout.Override.SpecialRowSeparatorAppearance.BackColor = Color.FromArgb(233, 242, 199) ' You can change the icons and the text of the filter operators by using the ' FilterOperatorsValueList property. ' Dim valueList As ValueList = e.Layout.FilterOperatorsValueList Dim item As ValueListItem For Each item In valueList.ValueListItems Dim filterOperator As FilterComparisionOperator = DirectCast(item.DataValue, FilterComparisionOperator) If FilterComparisionOperator.Equals = filterOperator Then ' You can change the DisplayText of the value list item to change the text of the ' filter operator. item.DisplayText = "EQUALS" ' You can set the Image of the item's appearance to change the filter operator ' icon to a different image. You can set it to null to take out the image. item.Appearance.Image = Nothing End If Next ' FilterRowSpacingBefore and FilterRowSpacingAfter can be used to leave space before ' and after the filter row. By default no space is left before and after the filter row. e.Layout.Override.FilterRowSpacingBefore = 5 e.Layout.Override.FilterRowSpacingAfter = 5 End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void UltraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { // Appearance of the filter row can be controlled using the FilterRowAppearance proeprty. e.Layout.Override.FilterRowAppearance.BackColor = Color.LightYellow; // Appearance of the row selector of the filter row can be controlled using the // FilterRowSelectorAppearance property. e.Layout.Override.FilterRowSelectorAppearance.Image = someImage; // FilterRowAppearanceActive applies to the filter row when the filter row has some // filter criteria. Likewise with the FilterCellAppearanceActive. It gets applied to // the filter cell that currently contains some filter criteria. e.Layout.Override.FilterRowAppearanceActive.BackColor = Color.LightBlue; e.Layout.Override.FilterCellAppearanceActive.ForeColor = Color.Red; // Appearance of the filter cells can be controlled using the FilterCellAppearance // property. FilterCellAppearance property is also exposed off the column so the // filter cell appearance can be controlled on a per column basis. e.Layout.Override.FilterCellAppearance.ForeColor = Color.Blue; e.Layout.Bands[0].Columns[0].FilterCellAppearance.ForeColor = Color.Maroon; // You can use the FilterRowPrompt to display a prompt in the filter row. By default // UltraGrid does not display any prompt in the filter row. e.Layout.Override.FilterRowPrompt = "Click here to filter data..."; // You can use the FilterRowPromptAppearance to change the appearance of the prompt. // By default the prompt is transparent and uses the same fore color as the filter row. // You can make it non-transparent by setting the appearance' BackColorAlpha property // or by setting the BackColor to a desired value. e.Layout.Override.FilterRowPromptAppearance.BackColorAlpha = Alpha.Opaque; // You can use the FilterOperatorAppearance to change the appearance of the filter // operator ui if it's visible. This property is exposed off the column as well. e.Layout.Override.FilterOperatorAppearance.ForeColor = Color.Blue; e.Layout.Bands[0].Columns[0].FilterOperatorAppearance.ForeColor = Color.Maroon; // Border style of the filter cells can be controlled using the BorderStyleFilterCell // property. e.Layout.Override.BorderStyleFilterCell = UIElementBorderStyle.Solid; // BorderStyleFilterRow property controls the border style of the filter row. e.Layout.Override.BorderStyleFilterRow = UIElementBorderStyle.Solid; // BorderStyleFilterOperator controls the border style of the filter operator ui if // it's visible. e.Layout.Override.BorderStyleFilterOperator = UIElementBorderStyle.Dotted; // By default the prompt is spread across multiple cells if it's bigger than the // first cell. You can confine the prompt to a particular cell by setting the // SpecialRowPromptField property off the band to the key of a column. e.Layout.Bands[0].SpecialRowPromptField = e.Layout.Bands[0].Columns[0].Key; // Display a separator between the filter row other rows. SpecialRowSeparator property // can be used to display separators between various 'special' rows, including for the // filter row. This property is a flagged enum property so it can take multiple values. e.Layout.Override.SpecialRowSeparator = SpecialRowSeparator.FilterRow; // You can control the appearance of the separator using the SpecialRowSeparatorAppearance // property. e.Layout.Override.SpecialRowSeparatorAppearance.BackColor = Color.FromArgb( 233, 242, 199 ); // You can change the icons and the text of the filter operators by using the // FilterOperatorsValueList property. // ValueList valueList = e.Layout.FilterOperatorsValueList; foreach ( ValueListItem item in valueList.ValueListItems ) { FilterComparisionOperator filterOperator = (FilterComparisionOperator)item.DataValue; if ( FilterComparisionOperator.Equals == filterOperator ) { // You can change the DisplayText of the value list item to change the text of the // filter operator. item.DisplayText = "EQUALS"; // You can set the Image of the item's appearance to change the filter operator // icon to a different image. You can set it to null to take out the image. item.Appearance.Image = someImage; } } // FilterRowSpacingBefore and FilterRowSpacingAfter can be used to leave space before // and after the filter row. By default no space is left before and after the filter row. e.Layout.Override.FilterRowSpacingBefore = 5; e.Layout.Override.FilterRowSpacingAfter = 5; }