dynamic datagrids and allowsorting

Discussion in 'ASP .Net Web Controls' started by Dan Dorey via .NET 247, Aug 4, 2004.

  1. 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>
     
    Dan Dorey via .NET 247, Aug 4, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cowboy \(Gregory A. Beamer\)

    Export datagrid(with allowsorting) to Excel

    Cowboy \(Gregory A. Beamer\), Jun 25, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    533
  2. =?Utf-8?B?a2g=?=

    DataGrid.AllowSorting and CssClass

    =?Utf-8?B?a2g=?=, Aug 2, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,557
    Joe Fallon
    Aug 3, 2004
  3. Samuel Shulman

    AllowSorting dosn't work

    Samuel Shulman, Jun 13, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    3,679
    Samuel Shulman
    Jun 13, 2006
  4. Julia B
    Replies:
    0
    Views:
    781
    Julia B
    Nov 3, 2009
  5. tony010409020622@

    AllowSorting = True, BUT Web DataGrid Wont Sort

    tony010409020622@, Sep 29, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    193
    Scott M.
    Sep 29, 2005
Loading...

Share This Page