Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

dynamic datagrids and allowsorting

 
 
Dan Dorey via .NET 247
Guest
Posts: n/a
 
      08-04-2004
Hey,

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

newPanel.Controls.Add(lblTitle)
newPanel.Controls.Add(dgGen)

Me.Page.Controls.Add(newPanel)

' 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,
Dan

--------------------------------
From: Dan Dorey

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>WzkY5vvNMEGqxkGusrAvhw==</Id>
 
Reply With Quote
 
 
 
Reply

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 tony010409020622@spamthis@hotmail.com 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



Advertisments