asp.net.ph

DataGridPagerStyle.Mode Property

System.Web.UI.WebControls Namespace   DataGridPagerStyle Class


Sets or retrieves a value that specifies whether the pager element displays buttons that link to the next and previous page, or numeric buttons that link directly to a page.

Syntax


Inline <pagerstyle mode = enumValue ... >
Script DataGrid.PagerStyle.Mode = enumValue

Property Value


enumValue One of the PagerMode values.

The property is read/write with a default value of NextPrev.

Exceptions


Exception Type Condition
ArgumentException The given value is not one of the PagerMode values.

Remarks

Use the Mode property to specify which set of pager buttons to use on the DataGrid control. You can specify buttons that link to the next and previous page, or numeric buttons that link directly to a page.

Example

The following example demonstrates how to programmatically set the PagerStyle.Mode property at run time. This simple script dynamically changes the display mode of the pager based on the state of a CheckBox named chkNumbers.

if ( chkNumbers.Checked )
   myGrid.PagerStyle.Mode = PagerMode.NumericPages;
else
   myGrid.PagerStyle.Mode = PagerMode.NextPrev;

 Show me 

See Also

DataGridPagerStyle Members   PagerMode Enum   Position   Visible Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph