ASP.NET Grid Documentation — Grid Class

Obout.Grid namespace
Obout.Grid.Grid class
<%@ Register TagPrefix="obout" Namespace="Obout.Grid" Assembly="obout_Grid_NET" %>

Accessibility

Name Description
propertyAllowKeyNavigation Bool. Enables the Key Navigation feature. Default: false

See also working example.

Add/Edit/Delete

Name Description
propertyAllowAddingRecords Bool. If set to true, the grid will have links for adding new records.
Default: true

See also working example.
propertyAllowMultiRecordAdding Bool. Enables/disables the multi-record adding feature. Default: false

See also working example.
propertyAllowMultiRecordEditing Bool. Enables/disables the multi-record editing feature. Default: false

See also working example.
propertyAllowMultiRecordDeleting Bool. Enables/disables the multi-record deleting feature. Default: false

See also working example.
propertyEnableTypeValidation Bool. Enable/disable to Type Validation feature. Default: true

See also working example.

Appearance

Name Description
propertyCssSettings GridCssSettings. Complex property containing all the css settings for the Grid.
propertyFolderStyle String. Path to the folder with style to use.

Client-Side Events

Name Description
propertyClientSideEvents GridClientSideEvents. Complex property used for setting the client-side events.

Columns

Name Description
propertyAllowColumnResizing Bool. Show/hide the tooltip that appears when columns are resized. Default: true

See also working example.
propertyAutoGenerateColumns Bool. By setting this property to true, all the columns from the specified datasource will be added to the grid.To have more control over the columns of the grid you need to set AutoGenerateColumns to false. Default: true

See also working example.
methodColumns ColumnCollection. A collection of Column objects - the columns of the Grid.
propertyShowTooltipOnResize Bool. Enable/disable column resizing. Default: true

See also working example.

Data

Name Description
propertyDataSource Object. Property used for setting the data source of the grid.
propertyDataSourceID String. The Control ID of an IDataSource that will be used as the data source.
methodClearPreviousDataSource Method that should be called before changing the data source of the Grid.

See also working example.

Events

Name Description
methodOnSelect Server-side event that is executed when a record is selected.
methodOnInsertCommand Server-side event that is executed when a new record is added.
methodOnUpdateCommand Server-side event that is executed when a record is updated.
methodOnDeleteCommand Server-side event that is executed when a record is deleted.
methodOnRebind Server-side event that is executed after the OnInsertCommand,
OnUpdateCommand and OnDeleteCommand events.
methodOnRowCreated Server-side event that is raised when GridRow objects are created.
methodOnRowDataBound Server-side event that is raised when GridRow objects are bound to their data.
methodOnColumnsCreated Server-side event that is raised after the columns are created.

Exporting

Name Description
propertyExportingSettings GridExportingSettings. Gets or sets the settings for the exporting feature of the Grid.
propertyFolderExports String. The name of the folder where the exported Excel/Word files will be written.

See also working example.
propertyExportToExcel Method. Exports the data from the Grid to MS Excel.

ExportToExcel ( FileName , KeepFormatting , UsePaging , AppendTimeStamp , Office2007 , UseHiddenColumns , ColumnsForExport )

  • FileName - the name of the file (without extension) where the data will be exported
  • KeepFormatting - if set to true some of the properties of the columns will
    also be exported (Width, Align, HeaderAling, Wrap)
  • UsePaging - export all the records or just the current page.
  • AppendTimeStamp - append a timestamp to the name of the file (for generating unique file names).
  • Office2007 - if set to true, the generated file will be compatible with MS Excel 2007.
  • UseHiddenColumns - if set to true, the invisible columns will be exported too.
  • ColumnsForExport - a string containing the columns that will be exported.



  • grid1.ExportToExcel("OboutGrid", true, false, true, false)
     
    propertyExportToWord Method. Exports the data from the Grid to MS Word.

    ExportToWord ( FileName , KeepFormatting , UsePaging , AppendTimeStamp , Office2007 , UseHiddenColumns , ColumnsForExport )

  • FileName - the name of the file (without extension) where the data will be exported
  • KeepFormatting - if set to true some of the properties of the columns will
    also be exported (Width, Align, HeaderAling, Wrap)
  • UsePaging - export all the records or just the current page.
  • AppendTimeStamp - append a timestamp to the name of the file (for generating unique file names).
  • Office2007 - if set to true, the generated file will be compatible with MS Word 2007.
  • UseHiddenColumns - if set to true, the invisible columns will be exported too.
  • ColumnsForExport - a string containing the columns that will be exported.



  • grid1.ExportToWord("OboutGrid", true, false, true, true)
     

    Filtering

    Name Description
    propertyAllowFiltering Bool. Enables/disables the filtering feature. Default: false

    See also working example.
    propertyEmbedFilterInSortExpression Bool. Used for optimizing the performance when the Grid is bound to an ObjectDataSourceControl that has the paging feature enabled. Default: false

    See also working example.

    Grouping

    Name Description
    propertyAllowGrouping Bool. Enables/disables the Grouping feature. Default: false

    See also working example.
    propertyGroupBy String. Used to group the Grid by the specified columns.

    See also working example.
    propertyShowCollpasedGroups Bool. If true, the groups will initially be collapsed. Default: false

    See also working example.
    propertyShowMultiPageGroupsInfo Bool. If true, the groups that spread on multiple pages will have additional information about the records in the header of the group. Default: true

    See also working example.

    Layout

    Name Description
    propertyShowHeader Bool. Property used for showing/hiding the header of the grid. Default: true

    See also working example.
    propertyShowFooter Bool. Property used for showing/hiding the footer of the grid. Default: true

    See also working example.
    propertyWidth Unit. The width of the Grid.


    See also working example.

    Localization

    Name Description
    propertyFolderLocalization String. Path to folder with localization xml files. Default: grid/localization

    See also working example.
    propertyLanguage String. Name of the language to be used. Default: en

    See also working example.
    propertyLocalizationSettings GridLocalizationSettings. Complex property used to define the localization settings.

    See also working example.

    Master / Detail

    Name Description
    propertyMasterDetailSettings GridMasterDetailSettings. Defines the settings for the master/detail feature.

    See also working example.


    Misc
    Name Description
    propertyID String. The ID of the Grid control.
    propertyIsCallback Bool. Read-only property that indicates if a callback has occurred.

    Paging

    Name Description
    propertyAllowManualPaging Bool. Enables/disables the manual paging feature (which allows users to navigate through the pages by entering the page number into a textbox). Default: false

    See also working example.
    propertyAllowPageSizeSelection Bool. Show/Hide the Page Size selection drop-down. Default: true

    See also working example.
    propertyAllowPaging Bool. Show/Hide the buttons for changing the page. Default: true

    See also working example.
    propertyCurrentPageIndex Int. The zero starting index of page that is displayed in the grid. Default: 0

    See also working example.
    propertyNumberOfPagesShownInFooter Int. Sets the number of pages displayed in the footer. Default: 5

    See also working example.
    propertyPageSize Int. The number of records to be displayed on a page. Default: 10

    See also working example.
    propertyPageSizeOptions String. The options for the "Records per page" drop-down list.
    Default: 1,2,3,4,5,6,7,8,9,10,50,100,500

    See also working example.
    propertyShowTotalNumberOfPages Bool. If true, the total number of pages will be shown in the footer. Default: false

    See also working example.

    Scrolling

    Name Description
    propertyScrollingSettings GridScrollingSettings. Property used to define the scrolling settings for the Grid.

    Selecting Records

    Name Description
    propertyAllowMultiRecordSelection Bool. Enable/disable the multi record selection feature.
    Default: true

    See also working example.
    propertyAllowRecordSelection Bool. Enable/disable the record selection feature.
    Default: true

    See also working example.
    propertyAutoPostBackOnSelect Bool. If true, the page will be posted back to the server when a record is selected.
    Default: false

    See also working example.
    propertyKeepSelectedRecords Bool. If set to true, the selected records will keep their state between callbacks/postbacks.
    Default: true

    See also working example.
    propertySelectedRecords ArrayList. Collection which contains all the selected records.


    See also working example.

    Settings

    Name Description
    propertyCallbackMode Bool. Setting this property to true will make the Grid work in callback mode (all the actions will be executed with AJAX callbacks). If CallbackMode is set to false, each action will trigger a postback of the page. Default: true

    See also working example.
    propertyEnableRecordHover Bool. Enables/disables hover effects when the mouse is over the records.

    See also working example.
    propertyGenerateRecordIds Bool. If true, each record will have a unique ID
    that can be used on the client-side.

    See also working example.
    propertyShowLoadingMessage Bool. Enables/disables the displaying of the "Loading..." message.
    Default: true

    See also working example.
    propertySerialize Bool. Enables grid serialization into VIEWSTATE (this way, the grid is binded only once
    to the datasource). For grids with a large number of records, we recommend to set
    Serialize to false for better performance. Default: true

    See also Serialize tutorial.

    Sorting

    Name Description
    propertyAllowSorting Bool. If set to true, the grid will have sorting capabilities. Default: true

    See also working example.

    Templates

    Name Description
    methodTemplates TemplatesCollection. A collection of GridTemplate objects - the templates that will be used by the columns.
    methodTemplateSettings GridTemplateSettings. Property used to define the template settings for the Grid.
    obout.com
    obout.com Home
    News
    Grid Home 
    Grid Home
    Download
    Site Map
    Examples - 313
    Appearance - 2
    Live Styles
    Populating with data - 16
    Declaratively (Design-time) - 4
    Binding to ObjectDataSource
    Binding to SqlDataSource
    Binding to XmlDataSource
    Populating from Stored Procedures
    At Run-time - 6
    Binding to DataSet
    Binding to DataReader
    Binding to DataTable
    Binding to Generic Collections
    Binding to Linq
    Binding to LinqDataSource
    Best Performance - 3
    DataSourceNeeded Event New
    Paged ObjectDataSource
    Partial Load
    Miscellaneous - 3
    Switching Data Sources New
    Populate on Button Click New
    Pivot Table
    Add/Edit/Delete - 26
    Standard - 3
    Add/Edit/Delete Records
    Multi-Record
    Position for New Record/Links New
    Custom Editors - 5
    Using Custom Forms
    Sliding Row Editor
    Using Super Form
    Using Super Form in Window
    Using Flyout
    Excel-Style - 2
    Excel-Style New
    Excel-Style with Autosave New
    Custom Triggers - 4
    Edit using Context Menu
    Edit on Click
    Edit on Double-Click
    Edit on Dbl-Click with Auto-Save
    Saving to Database - 8
    Automatic Updates
    Using SqlDataSource
    Using ObjectDataSource
    Using Stored Procedures New
    Detect Unsaved Changes
    Add to empty table
    Default Values for Add/Edit
    Save Changes on the Client Side New
    User Confirmation - 2
    Before Insert / Update / Delete
    Confirmation Using Window
    Handling Errors - 2
    Handling Errors
    Handling Errors with Row Templates
    Record Selection - 13
    Standard Selection - 2
    Select Records
    PostBack on Select
    Custom Selection - 5
    Select using Check Boxes New
    Select using only Check Boxes New
    Select using Radio Buttons
    Select using Checkmark
    Select All Group Records
    Multiselect without CTRL/SHIFT New
    Retrieve Selected Records - 2
    Find Selected Records - Client-Side
    Find Selected Records - Server-Side
    Programmatic Selection - 3
    Client-Side
    Server-Side
    Select All Records
    Columns - 22
    Manipulating Columns - 4
    Resizing Columns
    Dynamic Column Resizing New
    Reordering Columns New
    Show / Hide Columns
    Column Types - 2
    CheckBoxColumn New
    CheckBoxSelectColumn New
    Settings - 15
    AutoGenerateColumns
    Align / HeaderAlign
    AllowEdit / AllowDelete
    ApplyFormatInEditMode
    DataFormatString
    Index
    NullDisplayText
    ParseHTML
    ReadOnly
    Wrap
    Visible
    Width
    Relative Widths
    Relative Width for the Columns/Grid
    Auto Resize Columns New
    Miscellaneous - 1
    Different Styles
    Paging - 7
    Mode - 2
    Standard Paging
    Manual Paging
    Customization - 4
    Position New
    Customize Paging
    Customize Numbers of Pages
    Show ALL records
    Client-Side API - 1
    Change Page on Client
    Sorting - 4
    Sorting
    Multi-Column Sorting
    Sorting Week Days
    Allow Sorting for Columns New
    Filtering - 25
    Standard Filtering - 1
    Filtering Records
    Custom Filtering - 8
    Filter Templates
    Filter with Date Picker New
    Custom Filter Options with Templates
    Between, By Year, By Month
    Filter Localized Dates
    Filter with On-Demand ComboBox
    Live Search New
    Filter All with Live Search New
    Filter Settings - 3
    Filter Position New
    Initial State
    ALL vs. ANY
    Column Settings - 3
    Enable/Disable Filtering for Columns
    Show/Hide Filter Criterias
    Customize Filter Options
    Programmatic Filtering - 6
    Initial Filter
    Programmatic Filter - Client-Side
    Alphabetic Filter
    Keeping Filter State
    External Filter Buttons
    Filter On Blur
    Best Performance - 2
    Filter with DataSourceNeeded Event
    Filter with Paged ObjectDataSource
    Miscellaneous - 2
    Validate Filters
    Master/Detail with External Filters
    Templates - 31
    Templates for Add/Edit
    Templates for the Filter
    Format Dates
    Grid With Images
    Add/Edit/Delete Buttons
    Add/Edit/Delete Images
    Multi-Record Add/Edit/Delete
    Filter Buttons
    Combine Columns
    Wrap the Headers
    Manual Paging
    Number the records
    GroupHeaderTemplateId
    Format Currencies
    Custom Formatting
    With Multiselect Listbox
    Edit Using CheckBoxList
    With Databound Controls
    DropDownList with 'New'
    View / Edit Details
    Customize for Mobile Devices
    Get values from textboxes
    Detail View
    Different Input Fields for Add/Edit
    Different Row Fields for Add/Edit
    Templates for Edit-Delete
    Reports and Row Templates
    Access checkboxes inside
    Access radio buttons inside
    Multiple Controls
    Scrolling - 16
    Vertical Scroll with Fixed Headers
    Horizontal Scroll
    Dynamic Horizontal Scroll New
    Vertical & Horizontal
    Automatic Scroll
    Horizontal Scroll and Filter
    Using Percentages
    Full Window Width / Height
    Automatic Resize with Splitter
    Fixed (Frozen) Columns
    Fixed (Frozen) Rows New
    Fixed Height
    Fixed Height in Percentages
    Virtual Scrolling New
    Virtual Scrolling with Paging New
    Keep Scroll On PostBack New
    Grouping - 14
    Grouping the Records
    Allow Grouping for Columns
    Initial Grouping
    Groups Information
    Multi-Page Groups Information
    Show Collapsed Groups
    Hide Columns When Grouping
    Keep Expanded
    Format the Group Headers
    Customize the Group Headers
    Custom Data in Group Headers New
    Expand/Collapse Groups
    Allow Changes New
    Group using CheckBoxes New
    Totals / Sub-Totals - 6
    Totals
    Sub-Totals in Group Footers
    Sub-Totals in Group Headers New
    Aggregates
    Totals of Selected Records
    Summary Row
    Master / Detail - 35
    Loading Mode - 4
    Load At Once (OnLoad)
    Load On Demand (OnCallback)
    Load On PostBack
    Load On PostBack with UpdatePanel
    Populate with Data - 1
    Populate from Stored Procedures
    Add / Edit / Delete - 6
    Add / edit / delete at runtime
    Declarative add / edit / delete New
    Using Stored Procedures New
    Excel Style New
    Using Super Form inside Window New
    Handling Errors New
    Self-Reference Display - 1
    TreeView Hierarchy New
    Settings - 3
    Show Empty Details - OnLoad
    Show Empty Details - OnCallback New
    Detail Grid State
    Miscellaneous - 4
    Multiple Details on the Same Level
    Unlimited Number of Levels
    Multiple Foreign Keys
    Display Info in Flyout New
    Templates - 4
    Templates for Action Buttons
    Detail Grid inside Row Template
    Inline Templates inside Detail Grid
    Row Template inside Detail Grid New
    Customizations - 12
    Expand/Collapse All
    Client-Side Manipulation
    Get Selected Records
    Expand/Collapse on Select
    Expand/Collapse using Hyperlinks New
    Different Styles New
    Select on Expand / Collapse
    Expand a single detail grid
    Keep Expanded Details New
    Separated Master/Detail Grids
    Expand / Collapse on client side
    Auto-Expanding (Fluid) Width New
    Column Sets - 4
    Column Sets New
    Column Sets on Multiple Levels New
    Scroll Column Sets Horizontally New
    Column Sets with Grouping New
    Exporting - 20
    Export to Excel / Word
    Export to PDF New
    Export to CSV New
    Export Large Data Sets New
    Export on Server Side
    Export Master/Detail Grids
    Export Groups
    Export Totals / Subtotals
    Export Templates
    Export Images
    Export Title / Footer
    Export Selected Records New
    Export CheckBoxColumn New
    Export Multiple Grids as a Single File New
    Export Column Sets New
    Customize Exported Files
    Customize Individual Rows
    Exported files Life Time
    OnClientExportStart/Finish
    ExportedFilesTargetWindow
    Accessibility - 2
    Key Navigation
    Customize the Keys
    Localization - 2
    Localization
    Custom Localization
    Client-Side Events - 2
    Add / Edit / Delete
    Expose the Sender
    Server-Side Events - 3
    RowCreated/RowDataBound
    ColumnsCreated
    Row Title
    Printing - 5
    Printing the Grid
    Printing All Pages
    Printing All Records without Scrollbars
    Printing Selected Records New
    Printing Selected Columns New
    Validation - 3
    Using ASP.NET Validators
    Validate Super Form inside Grid
    Type Validation
    Integration - 21
    E-Mail Client
    File Browser
    D-n-D to Tree
    Linked with TreeView
    Customers
    With Easy Menu
    With On-Demand ComboBox New
    With Master/Detail ComboBox New
    Context menu and CheckBoxes
    With DatePicker
    With Flyout
    With File Upload Progress
    With Tab Strip
    HTML Editor Inline
    HTML Editor in Row Template
    With Color Picker
    With Window
    Using Tooltips
    Inside Window
    Task List
    Purchase Order
    ASP.NET AJAX - 8
    Live Quotes
    With AJAX MaskedEditExtender
    With AJAX AlwaysVisible
    Millions of Records
    Populate Edit Fields
    View Row Details
    Cascading ComboBoxes New
    Cascading ComboBoxes in Row Template
    State Keeping - 3
    Save Column Widths
    Keep Current Page
    Keep Current Sort Order
    Other Features - 13
    ShowLoadingMessage
    Hover Effects
    Multiple Grids
    Refresh the Records
    Clear the records
    Generate IDs
    Client-Side Model
    Find and Replace
    Using ASP.NET Themes/Skins
    Multi columns validation
    Validate unknown columns
    Inline validation
    Millions of Records
    Mode - 2
    Callback Mode
    Postback Mode
    Layout Customization- 4
    Heading New
    Rows - 4
    Reorder Rows New
    Reorder Rows using Drag and Drop New
    Drag and Drop Rows between Grids New
    Customize Individual Rows
    Knowledge Base - 1
    Knowledge Base
    Documentation - 25
    Server-Side
    Column
    ColumnCollection
    ColumnTemplateSettings
    DetailGridLoadingMode
    DetailGridState
    FilterOption
    FilterOptionsCollection
    FilterOptionType
    Grid
    GridAddEditDeleteSettings
    GridClientSideEvents
    GridCssSettings
    GridExportingSettings
    GridFilterSettings
    GridGroupInformation
    GridGroupingSettings
    GridLocalizationSettings
    GridMasterDetailSettings
    GridPagingSettings
    GridRecordEventArgs
    GridRuntimeTemplate
    GridRuntimeTemplateEventArgs
    GridScrollingSettings
    GridTemplate
    GridTemplateSettings
    SortOrderType
    TemplateContainer
    TemplatesCollection
    Client-Side
    Client-Side API
    ChangeLog
    Tutorials - 18
    Add/Edit/Delete
    Updating the Database
    Updating using Linq
    Appearance
    Styles
    Styles - Advanced
    CSS Tutorial
    Client-Side API
    Client-Side Events
    Columns
    Columns
    Configuration
    Using the correct path
    Design-Time Support
    All Tutorials
    Choosing Data Source
    Changing Appearance
    Populating with Data
    Data-Binding
    Serialize
    Maximum Performance
    Selecting Records
    Access Selected Records
    Templates
    Templates
    Runtime Templates
    Templates for Buttons
    Miscellaneous Tutorials - 14
    Getting the Generated ID
    Loading the details with AJAX Page
    Selecting the inserted/updated record
    Server-side validation using Ajax
    Edit on Click
    Hide "no-records" message
    Sending parameters
    Disable combobox in Edit mode
    Bind data after specified the filter
    Get Column Index in template
    Custom readonly column
    Auto-scroll during postback
    Delete button
    Move records between grids