Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Sorting and paging

Reply
Thread Tools

Sorting and paging

 
 
DC Gringo
Guest
Posts: n/a
 
      02-26-2004
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


 
Reply With Quote
 
 
 
 
Scott Mitchell [MVP]
Guest
Posts: n/a
 
      02-26-2004
> 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/AS...uysfromrollaco
</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!




 
Reply With Quote
 
 
 
 
DC Gringo
Guest
Posts: n/a
 
      02-26-2004
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/AS...uysfromrollaco
> </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!
>
>
>
>



 
Reply With Quote
 
Scott Mitchell [MVP]
Guest
Posts: n/a
 
      02-26-2004
> 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/AS...uysfromrollaco
> > </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!
> >
> >
> >
> >

>
>



 
Reply With Quote
 
DC Gringo
Guest
Posts: n/a
 
      02-26-2004
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.DataGridSortCommandEvent Args) _
Handles DataGrid1.SortCommand
DataView.Sort = e.SortExpression
DataGrid1.DataBind()
End Sub

--END EXAMPLE CODE--

"Scott Mitchell [MVP]" <> wrote in message
news:J7r%b.2880$ m...
> > 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/AS...uysfromrollaco
> > > </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!
> > >
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Scott Mitchell [MVP]
Guest
Posts: n/a
 
      02-26-2004
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.DataGridSortCommandEvent Args) _
> Handles DataGrid1.SortCommand
> DataView.Sort = e.SortExpression
> DataGrid1.DataBind()
> End Sub
>
> --END EXAMPLE CODE--
>
> "Scott Mitchell [MVP]" <> wrote in message
> news:J7r%b.2880$ m...
> > > 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/AS...uysfromrollaco
> > > > </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!
> > > >
> > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
DC Gringo
Guest
Posts: n/a
 
      02-26-2004
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.DataGridSortCommandEvent Args) _
> > Handles DataGrid1.SortCommand
> > DataView.Sort = e.SortExpression
> > DataGrid1.DataBind()
> > End Sub
> >
> > --END EXAMPLE CODE--
> >
> > "Scott Mitchell [MVP]" <> wrote in message
> > news:J7r%b.2880$ m...
> > > > 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/AS...uysfromrollaco
> > > > > </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!
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Scott Mitchell [MVP]
Guest
Posts: n/a
 
      02-26-2004
> 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/AS...uysfromrollaco
</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!




 
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
Enabling browser back button for GridView Paging and Sorting in Ajax1.1 and 3.5 (using Visual Studio 2005/ Visual studio 2008) anil reddy ASP .Net 0 02-11-2009 04:22 PM
Combining numeric mode paging and nextPreview paging in datagrid Red ASP .Net 1 03-12-2005 11:41 PM
datagrid paging - customising paging style wh1974 ASP .Net 0 01-12-2005 03:48 PM
DataSet paging vs Datareader paging =?Utf-8?B?UGF0cmljay5PLklnZQ==?= ASP .Net 1 10-08-2004 02:13 PM
Paging Dr. Who, Paging Dr. Who... Father_Sicko@TheOrphanage.com Computer Security 1 07-02-2004 08:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57