• North American Sales: 1-800-231-8588
  • Global Contacts
  • My Account
Infragistics Infragistics
Menu
  • North American Sales: 1-800-321-8588
  • My Account
    • Sign In/Register
  • Design & DevelopmentDesign & Develop
    • Best Value
      Infragistics Ultimate The complete toolkit for building high performing web, mobile and desktop apps.
      Indigo.Design Use a unified platform for visual design, UX prototyping, code generation and application development.
    • Web
      Ignite UI for Angular Ignite UI for JavaScript Ignite UI for React Ultimate UI for ASP.NET Indigo.Design
    • Desktop
      Ultimate UI for Windows Forms Ultimate UI for WPF
      Prototyping
      Indigo.Design
    • Mobile
      Ultimate UI for Xamarin Ultimate UI for iOS Ultimate UI for Android
    • Automated Testing Tools
      Test Automation for Micro Focus UFT: Windows Forms Test Automation for Micro Focus UFT: WPF Test Automation for IBM RFT: Windows Forms
  • UX
    • Indigo.Design Desktop Collaborative prototyping and remote usability testing for UX & usability professionals
    • Indigo.Design A Unified Platform for Visual Design, UX Prototyping, Code Generation, and App Development
  • Business Intelligence
    • Reveal Embedded Accelerate your time to market with powerful, beautiful dashboards into your apps
    • Reveal App Empower everyone in your organization to use data to make smarter business decisions
  • Team Productivity
  • Learn & Support Support
    • Help & Support Documents
    • Blogs
    • Forums
    • Product Ideas
    • Reference Applications
    • Customer Stories
    • Webinars
    • eBook & Whitepapers
    • Events
  • Free Trials
  • Pricing
    • Product Pricing / Buy Online
    • Renew Existing License
    • Contact Us
ASP.NET
  • Product Platforms
  • More
ASP.NET
ASP.NET WebDataGrid DataViewState vs ViewState
  • Blog
  • Files
  • Wiki
  • Mentions
  • Tags
  • More
  • Cancel
  • New
ASP.NET requires membership for participation - click to join
  • ASP.NET
  • Accessing Extra Data in Data Bound Controls
  • ASP.NET Performance - A Place To Start
  • +Building an Ajax Master/Detail Page with the WebDataGrid
  • Building WebParts with NetAdvantage ASP.NET Controls
  • Data Binding the WebDataGrid to Common Data Sources
  • Getting Started with NetAdvantage ASP.NET
  • HTML5 Mode and Other Goodness in the WebRating Control
  • Implementing WebDataGrid Client Side Search
  • Introduction to the Infragistics Web Drag and Drop Framework
  • Learn to Build a WebDataGrid Custom Pager
  • Understanding Script Combining
  • Using ADO.NET to Perform CRUD Operations with the WebDataGrid
  • WebDataGrid 101: Fill the Grid with Data and Change the Look and Feel
  • +WebDataGrid : Import data from Excel & Export to Excel, PDF or XPS
  • WebDataGrid Client-Side CRUD
  • WebDataGrid DataViewState vs ViewState
  • WebDataGrid Validation

WebDataGrid DataViewState vs ViewState

Quick Summary

  • DataViewState stores only the row collection information (off by default)
  • ViewState stores “everything else”

Introduction

ASP.NET view state is a touchy subject. In recent years the entire concept of view state has been under scrutiny for it’s seemingly easy and endless abuse. But just as the baby should not be thrown out with the bath water, a mishandled tool does not render it useless.

Proper use of view state in ASP.NET pages can help performance (yes, I said help) and provide a number of other workflow and productivity benefits. This article’s aim is to dissect the differences between the WebDataGrid’s two view state properties: EnableDataViewState and EnableViewState.

Note: Before proceeding any further I strongly suggest that you read Dave Reed’s exceptional treatise on ASP.NET view state, TRULY Understanding ViewState as well as Scott Mitchell’s Understanding ASP.NET View State. These articles will set the foundation required to gain the proper perspective on how the grid’s view state flags work.

DataViewState

The concept of “data view state” was born from the Infragistics engineers’ desire to see view state handled correctly in the control. Traditionally ASP.NET controls place the values of nearly all properties into view state. Rather than stuffing all the grid’s data into HTML and ViewState, the WebDataGrid separates containers for data and any other of the grid’s properties. Therefore the only information placed in the DataViewState bag is the grid’s row collection. By default EnableDataViewState is set to false to ensure that data is included into view state upon explicit request.

Note: If you have DataViewState enabled along with the Paging behavior, only the current page’s row collection is tracked in the view state container.

EnableDataViewState

ViewState

 

While the WebDataGrid’s ViewState bag does not hold row collection information, it does keep track of style settings (CSS) and meta-data about the rows. Therefore if a user makes a customization to a row – the change in the row’s settings is maintained in ViewState even if the data itself is not persisted in the DataViewState bag. Taking this approach greatly reduces the view state maintained on a page.

By default the EnableViewState property is set to true.

EnableViewState

  • WebDataGrid
  • Share
  • History
  • More
  • Cancel
Related
Recommended