亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gridviewhelper.vb

?? gridviewhelpervb cla
?? VB
?? 第 1 頁 / 共 2 頁
字號(hào):
?'------------------------------------------------------------------------------------------
' Copyright ? 2006 Agrinei Sousa [www.agrinei.com]
'
' Esse código fonte é fornecido sem garantia de qualquer tipo.
' Sinta-se livre para utilizá-lo, modificá-lo e distribuí-lo,
' inclusive em aplica??es comerciais.
' é altamente desejável que essa mensagem n?o seja removida.
'------------------------------------------------------------------------------------------

Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls


Public Delegate Sub FooterEvent(ByVal row As GridViewRow)

''' <summary>
''' A class to allow you to add summaries and groups to a GridView, easily!
''' </summary>
Public Class GridViewHelper

	#Region "Fields"

	Private mGrid As GridView
	Private mGeneralSummaries As GridViewSummaryList
	Private mGroups As GridViewGroupList
	Private useFooter As Boolean
	Private groupSortDir As SortDirection

	#End Region

	Public ReadOnly Property Groups() As GridViewGroupList
		Get
			Return mGroups
		End Get
	End Property

	Public ReadOnly Property GeneralSummaries() As GridViewSummaryList
		Get
			Return mGeneralSummaries
		End Get
	End Property


	#Region "Messages"

	Private Const USE_ADEQUATE_METHOD_TO_REGISTER_THE_SUMMARY As String = "Use adequate method to register a summary with custom operation."
	Private Const GROUP_NOT_FOUND As String = "Group {0} not found. Please register the group before the summary."
	Private Const INVALID_SUMMARY As String = "Invalid summary."
	Private Const SUPPRESS_GROUP_ALREADY_DEFINED As String = "A suppress group is already defined. You can't define suppress AND summary groups simultaneously"
	Private Const ONE_GROUP_ALREADY_REGISTERED As String = "At least a group is already defined. A suppress group can't coexist with other groups"

	#End Region


	#Region "Events"

	''' <summary>
	''' Event triggered when a new group starts
	''' </summary>
	Public Event GroupStart As GroupEvent

	''' <summary>
	''' Event triggered when a group ends
	''' </summary>
	Public Event GroupEnd As GroupEvent

	''' <summary>
	''' Event triggered after a row for group header be inserted
	''' </summary>
	Public Event GroupHeader As GroupEvent

	''' <summary>
	''' Event triggered after a row for group summary be inserted
	''' </summary>
	Public Event GroupSummary As GroupEvent

	''' <summary>
	''' Event triggered after the general summaries be generated
	''' </summary>
	Public Event GeneralSummary As FooterEvent

	''' <summary>
	''' Event triggered when the footer is databound
	''' </summary>
	Public Event FooterDataBound As FooterEvent

	#End Region


	#Region "Constructors"

	Public Sub New(ByVal grd As GridView)
		Me.New(grd, False, SortDirection.Ascending)
	End Sub

	Public Sub New(ByVal grd As GridView, ByVal useFooterForGeneralSummaries As Boolean)
		Me.New(grd, useFooterForGeneralSummaries, SortDirection.Ascending)
	End Sub

	Public Sub New(ByVal grd As GridView, ByVal useFooterForGeneralSummaries As Boolean, ByVal groupSortDirection As SortDirection)
		Me.mGrid = grd
		Me.useFooter = useFooterForGeneralSummaries
		Me.groupSortDir = groupSortDirection
		Me.mGeneralSummaries = New GridViewSummaryList()
		Me.mGroups = New GridViewGroupList()
		AddHandler Me.mGrid.RowDataBound, AddressOf RowDataBoundHandler
	End Sub

	#End Region


	#Region "RegisterSummary overloads"

	Public Function RegisterSummary(ByVal column As String, ByVal operation As SummaryOperation) As GridViewSummary
		Return Me.RegisterSummary(column, [String].Empty, operation)
	End Function

	Public Function RegisterSummary(ByVal column As String, ByVal formatString As String, ByVal operation As SummaryOperation) As GridViewSummary
		If operation = SummaryOperation.[Custom] Then
			Throw New Exception(USE_ADEQUATE_METHOD_TO_REGISTER_THE_SUMMARY)
		End If

		' TO DO: Perform column validation...
		Dim s As New GridViewSummary(column, formatString, operation, Nothing)
		mGeneralSummaries.Add(s)

		' if general summaries are displayed in the footer, it must be set to visible
		If useFooter Then
			mGrid.ShowFooter = True
		End If

		Return s
	End Function

	Public Function RegisterSummary(ByVal column As String, ByVal operation As SummaryOperation, ByVal groupName As String) As GridViewSummary
		Return Me.RegisterSummary(column, [String].Empty, operation, groupName)
	End Function

	Public Function RegisterSummary(ByVal column As String, ByVal formatString As String, ByVal operation As SummaryOperation, ByVal groupName As String) As GridViewSummary
		If operation = SummaryOperation.[Custom] Then
			Throw New Exception(USE_ADEQUATE_METHOD_TO_REGISTER_THE_SUMMARY)
		End If

		Dim group As GridViewGroup = mGroups(groupName)
		If group Is Nothing Then
			Throw New Exception([String].Format(GROUP_NOT_FOUND, groupName))
		End If

		' TO DO: Perform column validation...
		Dim s As New GridViewSummary(column, formatString, operation, group)
		group.AddSummary(s)

		Return s
	End Function

	Public Function RegisterSummary(ByVal column As String, ByVal operation As CustomSummaryOperation, ByVal getResult As SummaryResultMethod) As GridViewSummary
		Return RegisterSummary(column, [String].Empty, operation, getResult)
	End Function

	Public Function RegisterSummary(ByVal column As String, ByVal formatString As String, ByVal operation As CustomSummaryOperation, ByVal getResult As SummaryResultMethod) As GridViewSummary
		' TO DO: Perform column validation...
		Dim s As New GridViewSummary(column, formatString, operation, getResult, Nothing)
		mGeneralSummaries.Add(s)

		' if general summaries are displayed in the footer, it must be set to visible
		If useFooter Then
			mGrid.ShowFooter = True
		End If

		Return s
	End Function

	Public Function RegisterSummary(ByVal column As String, ByVal operation As CustomSummaryOperation, ByVal getResult As SummaryResultMethod, ByVal groupName As String) As GridViewSummary
		Return RegisterSummary(column, [String].Empty, operation, getResult, groupName)
	End Function

	Public Function RegisterSummary(ByVal column As String, ByVal formatString As String, ByVal operation As CustomSummaryOperation, ByVal getResult As SummaryResultMethod, ByVal groupName As String) As GridViewSummary
		Dim group As GridViewGroup = mGroups(groupName)
		If group Is Nothing Then
			Throw New Exception([String].Format(GROUP_NOT_FOUND, groupName))
		End If

		' TO DO: Perform column validation...
		Dim s As New GridViewSummary(column, formatString, operation, getResult, group)
		group.AddSummary(s)

		Return s
	End Function

	Public Function RegisterSummary(ByVal s As GridViewSummary) As GridViewSummary
		If Not s.Validate() Then
			Throw New Exception(INVALID_SUMMARY)
		End If

		If s.Group Is Nothing Then
			' if general summaries are displayed in the footer, it must be set to visible
			If useFooter Then
				mGrid.ShowFooter = True
			End If

			mGeneralSummaries.Add(s)
ElseIf Not s.Group.ContainsSummary(s) Then
			s.Group.AddSummary(s)
		End If

		Return s
	End Function

	#End Region


	#Region "RegisterGroup overloads"

	Public Function RegisterGroup(ByVal column As String, ByVal auto As Boolean, ByVal hideGroupColumns As Boolean) As GridViewGroup
		Dim cols As String() = New String(0) {column}
		Return RegisterGroup(cols, auto, hideGroupColumns)
	End Function

	Public Function RegisterGroup(ByVal columns As String(), ByVal auto As Boolean, ByVal hideGroupColumns As Boolean) As GridViewGroup
		If HasSuppressGroup() Then
			Throw New Exception(SUPPRESS_GROUP_ALREADY_DEFINED)
		End If

		' TO DO: Perform column validation...
		Dim g As New GridViewGroup(columns, auto, hideGroupColumns)
		mGroups.Add(g)

		If hideGroupColumns Then
			For i As Integer = 0 To mGrid.Columns.Count - 1
				For j As Integer = 0 To columns.Length - 1
					If GetDataFieldName(mGrid.Columns(i)).ToLower() = columns(j).ToLower() Then
						mGrid.Columns(i).Visible = False
					End If
				Next
			Next
		End If

		Return g
	End Function

	#End Region


	#Region "SetSuppressGroup overloads"

	Public Function SetSuppressGroup(ByVal column As String) As GridViewGroup
		Dim cols As String() = New String(0) {column}
		Return SetSuppressGroup(cols)
	End Function

	Public Function SetSuppressGroup(ByVal columns As String()) As GridViewGroup
		If mGroups.Count > 0 Then
			Throw New Exception(ONE_GROUP_ALREADY_REGISTERED)
		End If

		' TO DO: Perform column validation...
		Dim g As New GridViewGroup(columns, True, False, False, False)
		mGroups.Add(g)

		' Disable paging because pager works in datarows that
		' will be suppressed
		mGrid.AllowPaging = False

		Return g
	End Function

	#End Region


	#Region "Private Helper functions"

	Private Function GetSequentialGroupColumns() As String
		Dim ret As String = [String].Empty

		For Each g As GridViewGroup In mGroups
			ret += g.Name.Replace("+"C, ","C) + ","
		Next
		Return ret.Substring(0, ret.Length - 1)
	End Function

	''' <summary>
	''' Compares the actual group values with the values of the current dataitem
	''' </summary>
	''' <param name="g"></param>
	''' <param name="dataitem"></param>
	''' <returns></returns>
	Private Function EvaluateEquals(ByVal g As GridViewGroup, ByVal dataitem As Object) As Boolean
		' The values wasn't initialized
		If g.ActualValues Is Nothing Then
			Return False
		End If
		For i As Integer = 0 To g.Columns.Length - 1

			If g.ActualValues(i) Is Nothing AndAlso DataBinder.Eval(dataitem, g.Columns(i)) IsNot Nothing Then
				Return False
			End If
			If g.ActualValues(i) IsNot Nothing AndAlso DataBinder.Eval(dataitem, g.Columns(i)) Is Nothing Then
				Return False
			End If
			If Not g.ActualValues(i).Equals(DataBinder.Eval(dataitem, g.Columns(i))) Then
				Return False
			End If
		Next

		Return True
	End Function

	Private Function HasSuppressGroup() As Boolean
		For Each g As GridViewGroup In mGroups
			If g.IsSuppressGroup Then
				Return True
			End If
		Next
		Return False
	End Function

	Private Function HasAutoSummary(ByVal list As List(Of GridViewSummary)) As Boolean
		For Each s As GridViewSummary In list
			If s.Automatic Then
				Return True
			End If
		Next
		Return False
	End Function

	Private Function GetGroupRowValues(ByVal g As GridViewGroup, ByVal dataitem As Object) As Object()
		Dim values As Object() = New Object(g.Columns.Length - 1) {}
		For i As Integer = 0 To g.Columns.Length - 1

			values(i) = DataBinder.Eval(dataitem, g.Columns(i))
		Next

		Return values
	End Function

	''' <summary>
	''' Inserts a grid row. Only cells required for the summary results
	''' will be created (except if GenerateAllCellsOnSummaryRow is true).
	''' The group will be checked for columns with summary
	''' </summary>
	''' <param name="beforeRow"></param>
	''' <param name="g"></param>
	''' <returns></returns>
	Private Function InsertGridRow(ByVal beforeRow As GridViewRow, ByVal g As GridViewGroup) As GridViewRow
		Dim colspan As Integer
		Dim cell As TableCell
		Dim tcArray As TableCell()
		Dim visibleColumns As Integer = Me.GetVisibleColumnCount()

		Dim tbl As Table = DirectCast(mGrid.Controls(0), Table)
		Dim newRowIndex As Integer = tbl.Rows.GetRowIndex(beforeRow)
		Dim newRow As New GridViewRow(newRowIndex, newRowIndex, DataControlRowType.DataRow, DataControlRowState.Normal)

		If g IsNot Nothing AndAlso (g.IsSuppressGroup OrElse g.GenerateAllCellsOnSummaryRow) Then
			' Create all the table cells
			tcArray = New TableCell(visibleColumns - 1) {}
			For i As Integer = 0 To visibleColumns - 1
				cell = New TableCell()
				cell.ApplyStyle(mGrid.Columns(GetRealIndexFromVisibleColumnIndex(i)).ItemStyle)
				cell.Text = "&nbsp;"
				tcArray(i) = cell
			Next
		Else
			' Create only the required table cells
			colspan = 0
			Dim tcc As New List(Of TableCell)()
			For i As Integer = 0 To mGrid.Columns.Count - 1
				If ColumnHasSummary(i, g) Then
					If colspan > 0 Then
						cell = New TableCell()
						cell.Text = "&nbsp;"
						cell.ColumnSpan = colspan
						tcc.Add(cell)
						colspan = 0
					End If

					' insert table cell and copy the style
					cell = New TableCell()
					cell.ApplyStyle(mGrid.Columns(i).ItemStyle)
					tcc.Add(cell)
ElseIf mGrid.Columns(i).Visible Then
					' A visible column that will have no cell because has
					' no summary. So we increase the colspan...
					colspan += 1
				End If
			Next

			If colspan > 0 Then
				cell = New TableCell()
				cell.Text = "&nbsp;"
				cell.ColumnSpan = colspan
				tcc.Add(cell)
				colspan = 0
			End If

			tcArray = New TableCell(tcc.Count - 1) {}
			tcc.CopyTo(tcArray)
		End If

		newRow.Cells.AddRange(tcArray)
		tbl.Controls.AddAt(newRowIndex, newRow)

		Return newRow
	End Function

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕一区二区三区乱码在线| 亚洲一区二区在线播放相泽| 欧美影片第一页| 国产成人综合网| 日本欧美一区二区在线观看| 亚洲欧美日韩系列| 久久精品网站免费观看| 91精品国产91热久久久做人人 | 久久久精品日韩欧美| 在线视频国内一区二区| 国产不卡视频一区| 久久99蜜桃精品| 日本中文字幕一区二区视频 | 亚洲欧洲日韩av| 久久伊人中文字幕| 日韩一区二区在线观看视频播放| 色综合久久九月婷婷色综合| 国产成人av资源| 久久国产麻豆精品| 日韩电影在线一区二区| 亚洲无人区一区| 夜夜夜精品看看| 亚洲精品国产第一综合99久久 | 樱桃视频在线观看一区| 国产精品短视频| 国产丝袜美腿一区二区三区| 精品国产免费久久| 91精品国产色综合久久不卡蜜臀| 成人久久视频在线观看| 日韩中文字幕区一区有砖一区 | 成人亚洲一区二区一| 久久99国产精品久久99| 麻豆传媒一区二区三区| 日本aⅴ免费视频一区二区三区| 亚洲高清在线视频| 五月婷婷色综合| 日韩国产成人精品| 蜜桃视频一区二区三区在线观看 | 久久99国产精品久久99 | 91在线观看地址| 色综合色综合色综合| 日本乱人伦一区| 欧洲中文字幕精品| 在线观看一区二区视频| 欧洲一区在线观看| 欧美日韩五月天| 91精品国产综合久久小美女| 日韩视频免费观看高清完整版| 日韩欧美国产1| 久久久精品国产免费观看同学| 久久久国际精品| 国产精品初高中害羞小美女文| 国产精品美女www爽爽爽| 亚洲免费观看高清完整版在线| 一区二区高清视频在线观看| 日韩精品乱码av一区二区| 久久精品免费观看| 国产iv一区二区三区| 91香蕉视频mp4| 欧美精选一区二区| 久久中文字幕电影| 综合久久久久综合| 亚洲成人av免费| 国模无码大尺度一区二区三区| 国产成人免费视频精品含羞草妖精| 成人av网站大全| 欧美日韩中文字幕一区| 欧美xxx久久| 日韩伦理av电影| 青青草国产精品97视觉盛宴 | 欧美日韩国产一级二级| 欧美大黄免费观看| 国产精品美女一区二区三区| 亚洲国产欧美日韩另类综合| 久久超碰97中文字幕| 91在线小视频| 日韩视频一区在线观看| 国产精品天天看| 日韩黄色一级片| 高清在线不卡av| 欧美喷潮久久久xxxxx| 久久久精品免费网站| 亚洲一区二区免费视频| 国产精品香蕉一区二区三区| 色婷婷国产精品久久包臀| 欧美精品一区二区三区在线| 亚洲美女视频在线观看| 午夜免费久久看| 97精品国产97久久久久久久久久久久| 欧美日韩成人综合在线一区二区| 国产欧美一区二区三区在线看蜜臀 | 精品国精品国产| 亚洲欧美一区二区三区极速播放| 麻豆91在线观看| 欧美自拍丝袜亚洲| 日本一区二区在线不卡| 男男gaygay亚洲| 在线中文字幕一区| 欧美国产激情二区三区| 美女视频黄 久久| 欧美吻胸吃奶大尺度电影| 国产人久久人人人人爽| 久久精品久久99精品久久| 欧美少妇一区二区| 中国av一区二区三区| 久久精品国产亚洲高清剧情介绍| 色婷婷一区二区三区四区| 中文一区在线播放| 国产在线精品一区二区三区不卡 | 亚洲成人在线免费| 99精品欧美一区| 中文幕一区二区三区久久蜜桃| 奇米色777欧美一区二区| 欧美亚洲综合另类| 亚洲免费三区一区二区| av一区二区久久| 欧美国产视频在线| 国产很黄免费观看久久| 亚洲精品在线观看网站| 日韩av网站免费在线| 欧美精品777| 午夜电影网一区| 欧美喷潮久久久xxxxx| 亚洲成人综合网站| 欧美性猛交xxxxxx富婆| 一区二区三区在线视频播放| 91社区在线播放| 中文字幕一区日韩精品欧美| av在线不卡观看免费观看| 中文字幕不卡三区| 成人av电影在线| 国产精品国产a| 91麻豆精品视频| 亚洲男人电影天堂| 91久久免费观看| 亚洲一区二区在线免费看| 欧美视频一区二区在线观看| 亚洲精品ww久久久久久p站| 在线一区二区三区四区五区| 亚洲蜜臀av乱码久久精品| 色先锋资源久久综合| 夜夜精品视频一区二区| 欧美三日本三级三级在线播放| 亚洲成人第一页| 日韩精品一区二区三区四区| 国产一区二区三区四区五区入口| 国产午夜精品福利| 99v久久综合狠狠综合久久| 亚洲另类色综合网站| 精品视频1区2区3区| 麻豆精品一区二区| 欧美国产乱子伦| 91小视频免费观看| 亚洲va韩国va欧美va| 欧美大肚乱孕交hd孕妇| 成人午夜在线播放| 一区二区三区国产| 日韩一区二区三区视频在线观看 | 精品一区二区三区久久久| 久久麻豆一区二区| 99re热这里只有精品视频| 亚洲午夜久久久久| 精品久久久久久综合日本欧美| 国产成人激情av| 樱花影视一区二区| 日韩一区二区免费在线观看| 国产精品白丝av| 亚洲欧美激情在线| 欧美一个色资源| 不卡的av在线播放| 天天综合天天做天天综合| 欧美大胆一级视频| 色综合久久天天| 老司机免费视频一区二区三区| 欧美国产乱子伦| 欧美日韩国产在线观看| 国产成人免费xxxxxxxx| 亚洲国产中文字幕| 久久品道一品道久久精品| 欧美优质美女网站| 国产综合色精品一区二区三区| 日韩一区在线看| 精品欧美久久久| 91久久久免费一区二区| 国模娜娜一区二区三区| 亚洲精品免费电影| 久久综合国产精品| 欧美嫩在线观看| 99re视频精品| 国产伦精品一区二区三区免费 | 久久精品久久久精品美女| 自拍偷拍国产精品| 久久婷婷国产综合国色天香| 欧美四级电影网| 成人精品视频一区二区三区尤物| 性做久久久久久久免费看| 中文字幕一区二区三区色视频| 日韩精品专区在线| 欧美日韩第一区日日骚| 91美女在线观看|