Click here to Skip to main content
12,348,728 members (32,040 online)
Click here to Skip to main content

Stats

75.8K views
2.2K downloads
49 bookmarked
Posted

Advanced Paging GridView with ASP.NET 2.0/3.5

, 7 Nov 2008 CPOL
Advanced paging GridView with ASP.NET 2.0/3.5
WizardGridView
Demo
App_Data
Bin
WizardGridView.dll
WizardGridView.pdb
WizardGridView
bin
Debug
WizardGridView.dll
Properties
Resources
WizardGridView.bmp
WizardGridView.suo
using System;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WizardGridView
{
    /// <summary>
    /// �����O�ȧ@���f�t WizardGridView ����ϥΡA���}�񵹶}�o�H���b�{�����ޥΡC
    /// </summary>
	public class WizardPagerLinkButton : LinkButton
	{
        // ����-UI
        private readonly IPostBackContainer _container;
        private bool _enableCallback;
        private string _callbackArgument;

        // ����-UI
        public WizardPagerLinkButton(IPostBackContainer container)
		{
			_container = container;
		}


        // ����-UI
		public void EnableCallback(string argument)
		{
			_enableCallback = true;
			_callbackArgument = argument;
		}


        // ����-UI
		public override bool CausesValidation
		{
			get { return false; }
			set { throw new ApplicationException("Cannot set validation on pager buttons"); }
		}


        // ����-UI
		protected override void Render(HtmlTextWriter writer)
		{
			SetCallbackProperties();
			base.Render(writer);
		}


        // ����-UI        
		private void SetCallbackProperties()
		{
			if (_enableCallback)
			{
				ICallbackContainer container = _container as ICallbackContainer;
				if (container != null)
				{
					string callbackScript = container.GetCallbackScript(this, _callbackArgument);
					if (!string.IsNullOrEmpty(callbackScript)) OnClientClick = callbackScript;
				}
			}
		}		
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

WizardWu
Software Developer (Senior)
Taiwan Taiwan
A young programmer in Taipei City, Taiwan. Earn little money and just coding for fun.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160621.1 | Last Updated 7 Nov 2008
Article Copyright 2008 by WizardWu
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid