Sorting and paging

Discussion in 'ASP .Net Datagrid Control' started by DC Gringo, Feb 26, 2004.

  1. DC Gringo

    DC Gringo Guest

    I have set up numerous datagrid controls and had a recurring problem with
    the sorting and paging features. They simply don't work and generate and
    "error on page" every time.

    Help?

    --
    _____
    DC G
     
    DC Gringo, Feb 26, 2004
    #1
    1. Advertising

  2. > I have set up numerous datagrid controls and had a recurring problem
    with
    > the sorting and paging features. They simply don't work and generate

    and
    > "error on page" every time.


    What's the error message you get? Are you using Cassini as the Web
    server, or IIS? (I have noticed that with Cassini, at times, DataGrids
    with *large* ViewStates sometimes seem to muck up Cassini, resulting in a
    "No response from server" error in the browser.

    --

    <shameless plug>
    For more information on the DataGrid, DataList, and Repeater controls,
    consider picking up a copy of my latest book:

    ASP.NET Data Web Controls
    http://www.amazon.com/exec/obidos/ASIN/0672325012/4guysfromrollaco
    </shameless plug>

    Happy Programming!

    Scott Mitchell

    http://www.4GuysFromRolla.com
    http://www.ASPFAQs.com
    http://www.ASPMessageboard.com

    * When you think ASP, think 4GuysFromRolla.com!
     
    Scott Mitchell [MVP], Feb 26, 2004
    #2
    1. Advertising

  3. DC Gringo

    DC Gringo Guest

    I'm using IIS. Basically the hyperlinks don't do anything...clicking on it
    yields "error on page" in the lower status bar whether it's the sorting
    header or the paging 1-10 links.

    _____
    DC G



    "Scott Mitchell [MVP]" <> wrote in message
    news:Oup%b.2837$...
    > > I have set up numerous datagrid controls and had a recurring problem

    > with
    > > the sorting and paging features. They simply don't work and generate

    > and
    > > "error on page" every time.

    >
    > What's the error message you get? Are you using Cassini as the Web
    > server, or IIS? (I have noticed that with Cassini, at times, DataGrids
    > with *large* ViewStates sometimes seem to muck up Cassini, resulting in a
    > "No response from server" error in the browser.
    >
    > --
    >
    > <shameless plug>
    > For more information on the DataGrid, DataList, and Repeater controls,
    > consider picking up a copy of my latest book:
    >
    > ASP.NET Data Web Controls
    > http://www.amazon.com/exec/obidos/ASIN/0672325012/4guysfromrollaco
    > </shameless plug>
    >
    > Happy Programming!
    >
    > Scott Mitchell
    >
    > http://www.4GuysFromRolla.com
    > http://www.ASPFAQs.com
    > http://www.ASPMessageboard.com
    >
    > * When you think ASP, think 4GuysFromRolla.com!
    >
    >
    >
    >
     
    DC Gringo, Feb 26, 2004
    #3
  4. > I'm using IIS. Basically the hyperlinks don't do anything...clicking on
    it
    > yields "error on page" in the lower status bar whether it's the sorting
    > header or the paging 1-10 links.


    The error is a client-side JavaScript error, it sounds like. What if you
    click on that little error icon, what is the message it shows? What line
    number? Do a View/Source to see what line the problem is on.

    Just out of curiosity, are you using a User Control with a <form
    runat="server">...</form> in it?

    --

    Scott Mitchell

    http://www.4GuysFromRolla.com
    http://www.ASPFAQs.com
    http://www.ASPMessageboard.com

    * When you think ASP, think 4GuysFromRolla.com!




    > "Scott Mitchell [MVP]" <> wrote in message
    > news:Oup%b.2837$...
    > > > I have set up numerous datagrid controls and had a recurring problem

    > > with
    > > > the sorting and paging features. They simply don't work and

    generate
    > > and
    > > > "error on page" every time.

    > >
    > > What's the error message you get? Are you using Cassini as the Web
    > > server, or IIS? (I have noticed that with Cassini, at times,

    DataGrids
    > > with *large* ViewStates sometimes seem to muck up Cassini, resulting

    in a
    > > "No response from server" error in the browser.
    > >
    > > --
    > >
    > > <shameless plug>
    > > For more information on the DataGrid, DataList, and Repeater

    controls,
    > > consider picking up a copy of my latest book:
    > >
    > > ASP.NET Data Web Controls
    > >

    http://www.amazon.com/exec/obidos/ASIN/0672325012/4guysfromrollaco
    > > </shameless plug>
    > >
    > > Happy Programming!
    > >
    > > Scott Mitchell
    > >
    > > http://www.4GuysFromRolla.com
    > > http://www.ASPFAQs.com
    > > http://www.ASPMessageboard.com
    > >
    > > * When you think ASP, think 4GuysFromRolla.com!
    > >
    > >
    > >
    > >

    >
    >
     
    Scott Mitchell [MVP], Feb 26, 2004
    #4
  5. DC Gringo

    DC Gringo Guest

    Scott...you NAILED it!

    Two sets of form tags...what a rouse!!

    Ok, so now I'm getting somewhere...it is now posting back...what's left is
    handling the event of clicking on hyperlink to do the actual sort. The
    example I'm working with gives me the code below, but I'm using a DataSet of
    two tables from a stored procedure rather than a dataview. How would I
    modify this to suit?

    (Name of SqlDataAdapter DataSet is "DsAdvanced1". Tables are "table1" and
    "table2". I need to bind and sort "table1".)

    --START EXAMPLE CODE--

    Private Sub DataGrid1_SortCommand(ByVal source As Object, _
    ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) _
    Handles DataGrid1.SortCommand
    DataView.Sort = e.SortExpression
    DataGrid1.DataBind()
    End Sub

    --END EXAMPLE CODE--

    "Scott Mitchell [MVP]" <> wrote in message
    news:J7r%b.2880$...
    > > I'm using IIS. Basically the hyperlinks don't do anything...clicking on

    > it
    > > yields "error on page" in the lower status bar whether it's the sorting
    > > header or the paging 1-10 links.

    >
    > The error is a client-side JavaScript error, it sounds like. What if you
    > click on that little error icon, what is the message it shows? What line
    > number? Do a View/Source to see what line the problem is on.
    >
    > Just out of curiosity, are you using a User Control with a <form
    > runat="server">...</form> in it?
    >
    > --
    >
    > Scott Mitchell
    >
    > http://www.4GuysFromRolla.com
    > http://www.ASPFAQs.com
    > http://www.ASPMessageboard.com
    >
    > * When you think ASP, think 4GuysFromRolla.com!
    >
    >
    >
    >
    > > "Scott Mitchell [MVP]" <> wrote in message
    > > news:Oup%b.2837$...
    > > > > I have set up numerous datagrid controls and had a recurring problem
    > > > with
    > > > > the sorting and paging features. They simply don't work and

    > generate
    > > > and
    > > > > "error on page" every time.
    > > >
    > > > What's the error message you get? Are you using Cassini as the Web
    > > > server, or IIS? (I have noticed that with Cassini, at times,

    > DataGrids
    > > > with *large* ViewStates sometimes seem to muck up Cassini, resulting

    > in a
    > > > "No response from server" error in the browser.
    > > >
    > > > --
    > > >
    > > > <shameless plug>
    > > > For more information on the DataGrid, DataList, and Repeater

    > controls,
    > > > consider picking up a copy of my latest book:
    > > >
    > > > ASP.NET Data Web Controls
    > > >

    > http://www.amazon.com/exec/obidos/ASIN/0672325012/4guysfromrollaco
    > > > </shameless plug>
    > > >
    > > > Happy Programming!
    > > >
    > > > Scott Mitchell
    > > >
    > > > http://www.4GuysFromRolla.com
    > > > http://www.ASPFAQs.com
    > > > http://www.ASPMessageboard.com
    > > >
    > > > * When you think ASP, think 4GuysFromRolla.com!
    > > >
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    DC Gringo, Feb 26, 2004
    #5
  6. I don't think I'll be able to help you further - it sounds like you are
    using the GUI in VS.NET to bind data to a DataGrid. Personally, I have
    always done this in code myself, so I'm afraid I'm not familiar with the
    code generated by the GUI tools and how to utilize them.

    Good luck.

    --

    Scott Mitchell

    http://www.4GuysFromRolla.com
    http://www.ASPFAQs.com
    http://www.ASPMessageboard.com

    * When you think ASP, think 4GuysFromRolla.com!



    "DC Gringo" <> wrote in message
    news:Os%23bVKK$...
    > Scott...you NAILED it!
    >
    > Two sets of form tags...what a rouse!!
    >
    > Ok, so now I'm getting somewhere...it is now posting back...what's left

    is
    > handling the event of clicking on hyperlink to do the actual sort. The
    > example I'm working with gives me the code below, but I'm using a

    DataSet of
    > two tables from a stored procedure rather than a dataview. How would I
    > modify this to suit?
    >
    > (Name of SqlDataAdapter DataSet is "DsAdvanced1". Tables are "table1"

    and
    > "table2". I need to bind and sort "table1".)
    >
    > --START EXAMPLE CODE--
    >
    > Private Sub DataGrid1_SortCommand(ByVal source As Object, _
    > ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) _
    > Handles DataGrid1.SortCommand
    > DataView.Sort = e.SortExpression
    > DataGrid1.DataBind()
    > End Sub
    >
    > --END EXAMPLE CODE--
    >
    > "Scott Mitchell [MVP]" <> wrote in message
    > news:J7r%b.2880$...
    > > > I'm using IIS. Basically the hyperlinks don't do

    anything...clicking on
    > > it
    > > > yields "error on page" in the lower status bar whether it's the

    sorting
    > > > header or the paging 1-10 links.

    > >
    > > The error is a client-side JavaScript error, it sounds like. What if

    you
    > > click on that little error icon, what is the message it shows? What

    line
    > > number? Do a View/Source to see what line the problem is on.
    > >
    > > Just out of curiosity, are you using a User Control with a <form
    > > runat="server">...</form> in it?
    > >
    > > --
    > >
    > > Scott Mitchell
    > >
    > > http://www.4GuysFromRolla.com
    > > http://www.ASPFAQs.com
    > > http://www.ASPMessageboard.com
    > >
    > > * When you think ASP, think 4GuysFromRolla.com!
    > >
    > >
    > >
    > >
    > > > "Scott Mitchell [MVP]" <> wrote in

    message
    > > > news:Oup%b.2837$...
    > > > > > I have set up numerous datagrid controls and had a recurring

    problem
    > > > > with
    > > > > > the sorting and paging features. They simply don't work and

    > > generate
    > > > > and
    > > > > > "error on page" every time.
    > > > >
    > > > > What's the error message you get? Are you using Cassini as the

    Web
    > > > > server, or IIS? (I have noticed that with Cassini, at times,

    > > DataGrids
    > > > > with *large* ViewStates sometimes seem to muck up Cassini,

    resulting
    > > in a
    > > > > "No response from server" error in the browser.
    > > > >
    > > > > --
    > > > >
    > > > > <shameless plug>
    > > > > For more information on the DataGrid, DataList, and Repeater

    > > controls,
    > > > > consider picking up a copy of my latest book:
    > > > >
    > > > > ASP.NET Data Web Controls
    > > > >

    > > http://www.amazon.com/exec/obidos/ASIN/0672325012/4guysfromrollaco
    > > > > </shameless plug>
    > > > >
    > > > > Happy Programming!
    > > > >
    > > > > Scott Mitchell
    > > > >
    > > > > http://www.4GuysFromRolla.com
    > > > > http://www.ASPFAQs.com
    > > > > http://www.ASPMessageboard.com
    > > > >
    > > > > * When you think ASP, think 4GuysFromRolla.com!
    > > > >
    > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Scott Mitchell [MVP], Feb 26, 2004
    #6
  7. DC Gringo

    DC Gringo Guest

    Scott, yes you're right, I've not been terribly happy with using the GUI,
    I'm going to switch on this one pretty soon.

    _____
    DC G

    "Scott Mitchell [MVP]" <> wrote in message
    news:ues%b.2895$...
    > I don't think I'll be able to help you further - it sounds like you are
    > using the GUI in VS.NET to bind data to a DataGrid. Personally, I have
    > always done this in code myself, so I'm afraid I'm not familiar with the
    > code generated by the GUI tools and how to utilize them.
    >
    > Good luck.
    >
    > --
    >
    > Scott Mitchell
    >
    > http://www.4GuysFromRolla.com
    > http://www.ASPFAQs.com
    > http://www.ASPMessageboard.com
    >
    > * When you think ASP, think 4GuysFromRolla.com!
    >
    >
    >
    > "DC Gringo" <> wrote in message
    > news:Os%23bVKK$...
    > > Scott...you NAILED it!
    > >
    > > Two sets of form tags...what a rouse!!
    > >
    > > Ok, so now I'm getting somewhere...it is now posting back...what's left

    > is
    > > handling the event of clicking on hyperlink to do the actual sort. The
    > > example I'm working with gives me the code below, but I'm using a

    > DataSet of
    > > two tables from a stored procedure rather than a dataview. How would I
    > > modify this to suit?
    > >
    > > (Name of SqlDataAdapter DataSet is "DsAdvanced1". Tables are "table1"

    > and
    > > "table2". I need to bind and sort "table1".)
    > >
    > > --START EXAMPLE CODE--
    > >
    > > Private Sub DataGrid1_SortCommand(ByVal source As Object, _
    > > ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) _
    > > Handles DataGrid1.SortCommand
    > > DataView.Sort = e.SortExpression
    > > DataGrid1.DataBind()
    > > End Sub
    > >
    > > --END EXAMPLE CODE--
    > >
    > > "Scott Mitchell [MVP]" <> wrote in message
    > > news:J7r%b.2880$...
    > > > > I'm using IIS. Basically the hyperlinks don't do

    > anything...clicking on
    > > > it
    > > > > yields "error on page" in the lower status bar whether it's the

    > sorting
    > > > > header or the paging 1-10 links.
    > > >
    > > > The error is a client-side JavaScript error, it sounds like. What if

    > you
    > > > click on that little error icon, what is the message it shows? What

    > line
    > > > number? Do a View/Source to see what line the problem is on.
    > > >
    > > > Just out of curiosity, are you using a User Control with a <form
    > > > runat="server">...</form> in it?
    > > >
    > > > --
    > > >
    > > > Scott Mitchell
    > > >
    > > > http://www.4GuysFromRolla.com
    > > > http://www.ASPFAQs.com
    > > > http://www.ASPMessageboard.com
    > > >
    > > > * When you think ASP, think 4GuysFromRolla.com!
    > > >
    > > >
    > > >
    > > >
    > > > > "Scott Mitchell [MVP]" <> wrote in

    > message
    > > > > news:Oup%b.2837$...
    > > > > > > I have set up numerous datagrid controls and had a recurring

    > problem
    > > > > > with
    > > > > > > the sorting and paging features. They simply don't work and
    > > > generate
    > > > > > and
    > > > > > > "error on page" every time.
    > > > > >
    > > > > > What's the error message you get? Are you using Cassini as the

    > Web
    > > > > > server, or IIS? (I have noticed that with Cassini, at times,
    > > > DataGrids
    > > > > > with *large* ViewStates sometimes seem to muck up Cassini,

    > resulting
    > > > in a
    > > > > > "No response from server" error in the browser.
    > > > > >
    > > > > > --
    > > > > >
    > > > > > <shameless plug>
    > > > > > For more information on the DataGrid, DataList, and Repeater
    > > > controls,
    > > > > > consider picking up a copy of my latest book:
    > > > > >
    > > > > > ASP.NET Data Web Controls
    > > > > >
    > > > http://www.amazon.com/exec/obidos/ASIN/0672325012/4guysfromrollaco
    > > > > > </shameless plug>
    > > > > >
    > > > > > Happy Programming!
    > > > > >
    > > > > > Scott Mitchell
    > > > > >
    > > > > > http://www.4GuysFromRolla.com
    > > > > > http://www.ASPFAQs.com
    > > > > > http://www.ASPMessageboard.com
    > > > > >
    > > > > > * When you think ASP, think 4GuysFromRolla.com!
    > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    DC Gringo, Feb 26, 2004
    #7
  8. > Scott, yes you're right, I've not been terribly happy with using the
    GUI,
    > I'm going to switch on this one pretty soon.


    I teach a class on ASP.NET and it surprises me how many students use the
    GUI tools. In talking with high-end ASP.NET developers, I have found that
    virtually none of them employ these GUI tools...

    I applaud you for your decision. For more information on the DataGrid
    using the non-GUI techniques, I would (humbly) recommend that you check
    out this 15-part article series I wrote:

    An Extensive Examination of the DataGrid Web Control
    http://aspnet.4guysfromrolla.com/articles/040502-1.aspx

    Another great resource of common DataGrid questions (and answers) is
    available at:
    http://datawebcontrols.com

    Happy Programming!

    --

    <shameless plug>
    For more information on the DataGrid, DataList, and Repeater controls,
    consider picking up a copy of my latest book:

    ASP.NET Data Web Controls
    http://www.amazon.com/exec/obidos/ASIN/0672325012/4guysfromrollaco
    </shameless plug>

    Happy Programming!

    Scott Mitchell

    http://www.4GuysFromRolla.com
    http://www.ASPFAQs.com
    http://www.ASPMessageboard.com

    * When you think ASP, think 4GuysFromRolla.com!
     
    Scott Mitchell [MVP], Feb 26, 2004
    #8
    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. Mo
    Replies:
    1
    Views:
    4,195
    FFlannery
    Jan 30, 2004
  2. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    DataSet paging vs Datareader paging

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Oct 8, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    10,712
    Scott Allen
    Oct 8, 2004
  3. wh1974
    Replies:
    0
    Views:
    2,440
    wh1974
    Jan 12, 2005
  4. Red
    Replies:
    1
    Views:
    726
  5. anil reddy
    Replies:
    0
    Views:
    937
    anil reddy
    Feb 11, 2009
Loading...

Share This Page