C# 클래스 DataGridViewAutoFilter.DataGridViewAutoFilterMultiColumnHeaderCell

Provides a drop-down filter list in a DataGridViewColumnHeaderCell.
상속: System.Windows.Forms.DataGridViewColumnHeaderCell
파일 보기 프로젝트 열기: Duke-Jones/ED-IBE 1 사용 예제들

Private Properties

프로퍼티 타입 설명
AdjustPadding void
CmdOk_Click void
DataGridView_ColumnDisplayIndexChanged void
DataGridView_ColumnHeadersHeightChanged void
DataGridView_ColumnSortModeChanged void
DataGridView_ColumnWidthChanged void
DataGridView_DataBindingComplete void
DataGridView_DataSourceChanged void
DataGridView_Scroll void
DataGridView_SizeChanged void
DropDownListBox_KeyDown void
DropDownListBox_LostFocus void
HandleDataGridViewEvents void
HandleDropDownListBoxEvents void
InvalidateDropDownButtonBounds void
PopulateFilters void
RefreshDGV void
ResetDropDown void
ResetFilter void
SetDropDownButtonBounds void
SetDropDownListBoxBounds void
SortByColumn void
UnhandleDropDownListBoxEvents void
UpdateFilter void
VerifyDataSource void

공개 메소드들

메소드 설명
Clone ( ) : object

Creates an exact copy of this cell.

DataGridViewAutoFilterMultiColumnHeaderCell ( ) : System

Initializes a new instance of the DataGridViewColumnHeaderCell class.

DataGridViewAutoFilterMultiColumnHeaderCell ( System.Windows.Forms.DataGridViewColumnHeaderCell oldHeaderCell ) : System

Initializes a new instance of the DataGridViewColumnHeaderCell class and sets its property values to the property values of the specified DataGridViewColumnHeaderCell.

GetFilterStatus ( System.Windows.Forms.DataGridView dataGridView ) : String

Gets a status string for the specified DataGridView indicating the number of visible rows in the bound, filtered BindingSource, or String.Empty if all rows are currently visible.

HideDropDownList ( ) : void

Hides the drop-down filter list.

RemoveFilter ( System.Windows.Forms.DataGridView dataGridView ) : void

Removes the filter from the BindingSource bound to the specified DataGridView.

ShowDropDownList ( ) : void

Displays the drop-down filter list.

보호된 메소드들

메소드 설명
OnDataGridViewChanged ( ) : void

Called when the value of the DataGridView property changes in order to perform initialization that requires access to the owning control and column.

OnMouseDown ( System.Windows.Forms.DataGridViewCellMouseEventArgs e ) : void

Handles mouse clicks to the header cell, displaying the drop-down list or sorting the owning column as appropriate.

Paint ( Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState, object value, object formattedValue, string errorText, System.Windows.Forms.DataGridViewCellStyle cellStyle, System.Windows.Forms.DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts ) : void

Paints the column header cell, including the drop-down button.

비공개 메소드들

메소드 설명
AdjustPadding ( Int32 newDropDownButtonPaddingOffset ) : void

Adjusts the cell padding to widen the header by the drop-down button width.

CmdOk_Click ( object sender, EventArgs e ) : void
DataGridView_ColumnDisplayIndexChanged ( object sender, System.Windows.Forms.DataGridViewColumnEventArgs e ) : void

Invalidates the drop-down button bounds when the column display index changes.

DataGridView_ColumnHeadersHeightChanged ( object sender, EventArgs e ) : void

Invalidates the drop-down button bounds when the height of the column headers changes.

DataGridView_ColumnSortModeChanged ( object sender, System.Windows.Forms.DataGridViewColumnEventArgs e ) : void

Throws an exception when the column sort mode is changed to Automatic.

DataGridView_ColumnWidthChanged ( object sender, System.Windows.Forms.DataGridViewColumnEventArgs e ) : void

Invalidates the drop-down button bounds when a column width changes in the DataGridView control. A width change in any column of the control has the potential to affect the drop-down button location, depending on the current horizontal scrolling position and whether the changed column is to the left or right of the current column. It is easier to invalidate the button in all cases.

DataGridView_DataBindingComplete ( object sender, DataGridViewBindingCompleteEventArgs e ) : void

Invalidates the drop-down button bounds, hides the drop-down filter list, if it is showing, and resets the cached filter values if the filter has been removed.

DataGridView_DataSourceChanged ( object sender, EventArgs e ) : void

Verifies that the data source meets requirements, invalidates the drop-down button bounds, hides the drop-down filter list if it is showing, and resets the cached filter values if the filter has been removed.

DataGridView_Scroll ( object sender, ScrollEventArgs e ) : void

Invalidates the drop-down button bounds when the user scrolls horizontally.

DataGridView_SizeChanged ( object sender, EventArgs e ) : void

Invalidates the drop-down button bounds when the size of the DataGridView changes. This prevents a painting issue that occurs when the right edge of the control moves to the right and the control contents have previously been scrolled to the right.

DropDownListBox_KeyDown ( object sender, KeyEventArgs e ) : void

Handles the ENTER and ESC keys.

DropDownListBox_LostFocus ( object sender, EventArgs e ) : void

Hides the drop-down list when it loses focus.

HandleDataGridViewEvents ( ) : void

Add handlers to various DataGridView events, primarily to invalidate the drop-down button bounds, hide the drop-down list, and reset cached filter values when changes in the DataGridView require it.

HandleDropDownListBoxEvents ( ) : void

Adds handlers to ListBox events for handling mouse and keyboard input.

InvalidateDropDownButtonBounds ( ) : void

Sets dropDownButtonBoundsValue to Rectangle.Empty if it isn't already empty. This indicates that the button bounds should be recalculated.

PopulateFilters ( ) : void

Populates the filters dictionary with formatted and unformatted string representations of each unique value in the column, accounting for all filters except the current column's. Also adds special filter options.

RefreshDGV ( int currentRow ) : void

forces refreshing this tab

ResetDropDown ( ) : void

Invalidates the drop-down button bounds and hides the filter list if it is showing.

ResetFilter ( ) : void

Resets the cached filter values if the filter has been removed.

SetDropDownButtonBounds ( ) : void

Sets the position and size of dropDownButtonBoundsValue based on the current cell bounds and the preferred cell height for a single line of header text.

SetDropDownListBoxBounds ( ) : void

Sets the dropDownListBox.FilterListBox size and position based on the formatted values in the filters dictionary and the position of the drop-down button. Called only by ShowDropDownListBox.

SortByColumn ( ) : void

Sorts the DataGridView by the current column if AutomaticSortingEnabled is true.

UnhandleDropDownListBoxEvents ( ) : void

Removes the ListBox event handlers.

UpdateFilter ( ) : void

Updates the BindingSource.Filter value based on a user selection from the drop-down filter list.

VerifyDataSource ( ) : void

Confirms that the data source, if it has been set, is a BindingSource.

메소드 상세

Clone() 공개 메소드

Creates an exact copy of this cell.
public Clone ( ) : object
리턴 object

DataGridViewAutoFilterMultiColumnHeaderCell() 공개 메소드

Initializes a new instance of the DataGridViewColumnHeaderCell class.
public DataGridViewAutoFilterMultiColumnHeaderCell ( ) : System
리턴 System

DataGridViewAutoFilterMultiColumnHeaderCell() 공개 메소드

Initializes a new instance of the DataGridViewColumnHeaderCell class and sets its property values to the property values of the specified DataGridViewColumnHeaderCell.
public DataGridViewAutoFilterMultiColumnHeaderCell ( System.Windows.Forms.DataGridViewColumnHeaderCell oldHeaderCell ) : System
oldHeaderCell System.Windows.Forms.DataGridViewColumnHeaderCell The DataGridViewColumnHeaderCell to copy property values from.
리턴 System

GetFilterStatus() 공개 정적인 메소드

Gets a status string for the specified DataGridView indicating the number of visible rows in the bound, filtered BindingSource, or String.Empty if all rows are currently visible.
public static GetFilterStatus ( System.Windows.Forms.DataGridView dataGridView ) : String
dataGridView System.Windows.Forms.DataGridView The DataGridView bound to the /// BindingSource to return the filter status for.
리턴 String

HideDropDownList() 공개 메소드

Hides the drop-down filter list.
public HideDropDownList ( ) : void
리턴 void

OnDataGridViewChanged() 보호된 메소드

Called when the value of the DataGridView property changes in order to perform initialization that requires access to the owning control and column.
protected OnDataGridViewChanged ( ) : void
리턴 void

OnMouseDown() 보호된 메소드

Handles mouse clicks to the header cell, displaying the drop-down list or sorting the owning column as appropriate.
protected OnMouseDown ( System.Windows.Forms.DataGridViewCellMouseEventArgs e ) : void
e System.Windows.Forms.DataGridViewCellMouseEventArgs A DataGridViewCellMouseEventArgs that contains the event data.
리턴 void

Paint() 보호된 메소드

Paints the column header cell, including the drop-down button.
protected Paint ( Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState, object value, object formattedValue, string errorText, System.Windows.Forms.DataGridViewCellStyle cellStyle, System.Windows.Forms.DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts ) : void
graphics System.Drawing.Graphics The Graphics used to paint the DataGridViewCell.
clipBounds System.Drawing.Rectangle A Rectangle that represents the area of the DataGridView that needs to be repainted.
cellBounds System.Drawing.Rectangle A Rectangle that contains the bounds of the DataGridViewCell that is being painted.
rowIndex int The row index of the cell that is being painted.
cellState DataGridViewElementStates A bitwise combination of DataGridViewElementStates values that specifies the state of the cell.
value object The data of the DataGridViewCell that is being painted.
formattedValue object The formatted data of the DataGridViewCell that is being painted.
errorText string An error message that is associated with the cell.
cellStyle System.Windows.Forms.DataGridViewCellStyle A DataGridViewCellStyle that contains formatting and style information about the cell.
advancedBorderStyle System.Windows.Forms.DataGridViewAdvancedBorderStyle A DataGridViewAdvancedBorderStyle that contains border styles for the cell that is being painted.
paintParts DataGridViewPaintParts A bitwise combination of the DataGridViewPaintParts values that specifies which parts of the cell need to be painted.
리턴 void

RemoveFilter() 공개 정적인 메소드

Removes the filter from the BindingSource bound to the specified DataGridView.
public static RemoveFilter ( System.Windows.Forms.DataGridView dataGridView ) : void
dataGridView System.Windows.Forms.DataGridView The DataGridView bound to the BindingSource to unfilter.
리턴 void

ShowDropDownList() 공개 메소드

Displays the drop-down filter list.
public ShowDropDownList ( ) : void
리턴 void