Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > dynamic datagrids and allowsorting

Thread Tools

dynamic datagrids and allowsorting

Dan Dorey via .NET 247
Posts: n/a

I'm trying to write a generalized report that just takes some SQL as a parameter and then dynamically creates datagrids to display the information.

I can create the datagrid(s) and display the information just fine like so:

Dim newPanel As Panel = New Panel
Dim lblTitle As Label = New Label

Dim dgGen As DataGrid = New DataGrid
'dgGen.AllowSorting = True



' Then I bind the datagrid and it works fine... '

However, I need to enable sorting for these datagrids, but I get the following error when I do so:

"Control '_ctl2__ctl1__ctl0' of type 'DataGridLinkButton' must be placed inside a form tag with runat=server."

Thanks in advance,

From: Dan Dorey

Posted by a user from .NET 247 (

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview AllowSorting causing a problem Julia B ASP .Net 0 11-03-2009 03:49 PM
AllowSorting dosn't work Samuel Shulman ASP .Net 2 06-13-2006 08:48 PM
AllowSorting = True, BUT Web DataGrid Wont Sort ASP .Net Datagrid Control 1 09-29-2005 08:18 PM
DataGrid.AllowSorting and CssClass =?Utf-8?B?a2g=?= ASP .Net 3 08-02-2004 11:33 PM
Export datagrid(with allowsorting) to Excel Cowboy \(Gregory A. Beamer\) ASP .Net 6 07-04-2003 12:21 AM