Dynamic Column Creation Problem with Telerik RadGrid

by demtron on Monday, February 02, 2009 10:04 AM

As part of a large eCommerce project, I needed to be able to extend a grid control into a custom control and dynamically add columns.  I needed to change the order of events that determined when and how columns would be added.  After a rather large modification of several hundred lines of code, I found that the grid would throw  errors such as "Cannot create column with the specified type name".  AJAX sorting, filtering, and refreshes threw this error every time after the initial grid display.  This vexed me for over two days until I found the Telerik forums post at http://www.telerik.com/community/forums/aspnet-ajax/grid/dynamic-creation-of-columns.aspx.  The solution was to set the EnableColumnsViewState property of the MasterTableView to false and create the columns on Page.Init or on each Page.Load.

Sometimes, the easiest changes fix the most hair-pulling problems.  :-)

Powered by BlogEngine.NET
Theme by Mads Kristensen · Adapted by Demtron

Bookmark and Share


<<  July 2024  >>

View posts in large calendar
Log in

Milwaukee SEO Company

Milwaukee Access Programmer/Developer

Milwaukee Website Designer and Developer

Marketing / SEO

Blog Directory
blogarama - the blog directory
Milwaukee area SEO, SEM, ASP.Net