C# Class Nettiers.AdventureWorks.Web.UI.EntityGridView

Inherits all features of instinct GridView Control, also provides multi-sort, control of page size, export data to excel, etc.
Multi-sort technic is used from here: http://aspalliance.com/666 Excel export technic is used from here: http://www.codeproject.com/csharp/export2excel.asp
Inheritance: System.Web.UI.WebControls.GridView
ファイルを表示 Open project: netTiers/netTiers

Private Properties

Property Type Description
DisplayPageSizeSelector void
ExcelButton System.Web.UI.WebControls.LinkButton
cboPageSize_SelectedIndexChanged void
dsc_Selected void
dsc_Selected void
dsc_Selected void
exp_AfterFormat void
exp_BeforeFormat void
lnkExport_Click void

Protected Methods

Method Description
DisplaySortOrderImages ( string sortExpression, System.Web.UI.WebControls.GridViewRow dgItem ) : void

Display a graphic image for the Sort Order along with the sort sequence no.

GetDefaultSortColumn ( ) : string

Determine the first column in the column collection that has SortExpression value set, and using this column as a default sort column

GetSortExpression ( System.Web.UI.WebControls.GridViewSortEventArgs e ) : string

Get Sort Expression by Looking up the existing Grid View Sort Expression

ModifySortExpression ( string sortColumns, string sortExpression ) : string

Toggle the sort order or remove the column from sort appropriately

OnInit ( EventArgs e ) : void

Occurs when the server control is initialized.

OnPreRender ( EventArgs e ) : void

Occurs after the Control object is loaded but prior to rendering.

OnRowCreated ( System.Web.UI.WebControls.GridViewRowEventArgs e ) : void

Occurs when a row is created in a GridView control.

OnSorting ( System.Web.UI.WebControls.GridViewSortEventArgs e ) : void

Occurs when the hyperlink to sort a column is clicked, but before the EntityGridView control handles the sort operation.

SearchSortExpression ( string sortColumns, string sortColumn, string &sortOrder, int &sortOrderNo ) : void

Lookup the Current Sort Expression to determine the Order of a specific item.

Private Methods

Method Description
DisplayPageSizeSelector ( System.Web.UI.WebControls.GridViewRow dgItem ) : void
ExcelButton ( ) : LinkButton
cboPageSize_SelectedIndexChanged ( object sender, System e ) : void

Occurs when the value of the SelectedIndex property changes.

dsc_Selected ( object sender, System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs e ) : void

Retrieves data from the underlying data storage by calling the method that is identified by the SelectMethod property with the parameters in the SelectParameters collection.

Occurs when a Select operation has completed.

dsc_Selected ( object sender, System.Web.UI.WebControls.SqlDataSourceStatusEventArgs e ) : void

Retrieves data from the underlying data storage by calling the method that is identified by the SelectMethod property with the parameters in the SelectParameters collection.

Occurs when a Select operation has completed.

dsc_Selected ( object sender, Web e ) : void

Retrieves data from the underlying data storage by calling the method that is identified by the SelectMethod property with the parameters in the SelectParameters collection.

Occurs when a Select operation has completed.

exp_AfterFormat ( object sender, ExcelFormatEventArgs e ) : void

Occures after control is formatted

exp_BeforeFormat ( object sender, ExcelFormatEventArgs e ) : void

Occures before control is formatted

lnkExport_Click ( object sender, EventArgs e ) : void

Exporting all the records by rebinding the gridview and re-setting the page index

Method Details

DisplaySortOrderImages() protected method

Display a graphic image for the Sort Order along with the sort sequence no.
protected DisplaySortOrderImages ( string sortExpression, System.Web.UI.WebControls.GridViewRow dgItem ) : void
sortExpression string
dgItem System.Web.UI.WebControls.GridViewRow
return void

GetDefaultSortColumn() protected method

Determine the first column in the column collection that has SortExpression value set, and using this column as a default sort column
protected GetDefaultSortColumn ( ) : string
return string

GetSortExpression() protected method

Get Sort Expression by Looking up the existing Grid View Sort Expression
protected GetSortExpression ( System.Web.UI.WebControls.GridViewSortEventArgs e ) : string
e System.Web.UI.WebControls.GridViewSortEventArgs
return string

ModifySortExpression() protected method

Toggle the sort order or remove the column from sort appropriately
protected ModifySortExpression ( string sortColumns, string sortExpression ) : string
sortColumns string
sortExpression string
return string

OnInit() protected method

Occurs when the server control is initialized.
protected OnInit ( EventArgs e ) : void
e System.EventArgs
return void

OnPreRender() protected method

Occurs after the Control object is loaded but prior to rendering.
protected OnPreRender ( EventArgs e ) : void
e System.EventArgs
return void

OnRowCreated() protected method

Occurs when a row is created in a GridView control.
protected OnRowCreated ( System.Web.UI.WebControls.GridViewRowEventArgs e ) : void
e System.Web.UI.WebControls.GridViewRowEventArgs
return void

OnSorting() protected method

Occurs when the hyperlink to sort a column is clicked, but before the EntityGridView control handles the sort operation.
protected OnSorting ( System.Web.UI.WebControls.GridViewSortEventArgs e ) : void
e System.Web.UI.WebControls.GridViewSortEventArgs
return void

SearchSortExpression() protected method

Lookup the Current Sort Expression to determine the Order of a specific item.
protected SearchSortExpression ( string sortColumns, string sortColumn, string &sortOrder, int &sortOrderNo ) : void
sortColumns string
sortColumn string
sortOrder string
sortOrderNo int
return void