473,387 Members | 3,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Sorting datagrid?

Hi,

I have created a webpage with a datagrid. The page fills in the datagrid
after the user selected some things (it's a searchpage). Now the page show
everything from an SQL server sorted on productnumber.
How can I let the users change the sorting of the documents without always
having to get the data again from the SQL server?

Thanks
Joris
Apr 28 '06 #1
4 1106
Well you can't really unless you store the data in something like a session
variable or a cookie but this would be much less efecient than getting the
data again from the SQL server. Let SQL server do the sort, it's what it is
designed to do and it will do it much better than anything client side could.

"Joris De Groote" wrote:
Hi,

I have created a webpage with a datagrid. The page fills in the datagrid
after the user selected some things (it's a searchpage). Now the page show
everything from an SQL server sorted on productnumber.
How can I let the users change the sorting of the documents without always
having to get the data again from the SQL server?

Thanks
Joris

Apr 28 '06 #2
You can always Cache your data and then sort it client-side. However as
clickon said SQL server is more efficient in sorting

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"Joris De Groote" <jo************@skynet.be> wrote in message
news:e2*************@TK2MSFTNGP02.phx.gbl...
Hi,

I have created a webpage with a datagrid. The page fills in the datagrid
after the user selected some things (it's a searchpage). Now the page show
everything from an SQL server sorted on productnumber.
How can I let the users change the sorting of the documents without always
having to get the data again from the SQL server?

Thanks
Joris

Apr 28 '06 #3
OK, thanks clickon & swanand mokashi

I'll use the SQL server for the sorting.
"Swanand Mokashi" <sw***********@swanandmokashi.com> wrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
You can always Cache your data and then sort it client-side. However as
clickon said SQL server is more efficient in sorting

--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services
"Joris De Groote" <jo************@skynet.be> wrote in message
news:e2*************@TK2MSFTNGP02.phx.gbl...
Hi,

I have created a webpage with a datagrid. The page fills in the datagrid
after the user selected some things (it's a searchpage). Now the page
show everything from an SQL server sorted on productnumber.
How can I let the users change the sorting of the documents without
always having to get the data again from the SQL server?

Thanks
Joris


May 2 '06 #4


hi
joris u can use this method

create a dataset(ds)
put some data

create a sort string
(i.e. sortString = "ProductNameColumn desc")

now do this
ds.Tables[0].DefaultView.Sort = sortString;
PagedDataSource objPage = new PagedDataSource();
objPage.DataSource = ds.Tables[0].DefaultView;
MailsList.DataSource = objPage;

Now give me thanks
n bye gud nite (according to india)

Mukesh Agarwal
New Delhi
Joris De Groote wrote:
Hi,

I have created a webpage with a datagrid. The page fills in the datagrid
after the user selected some things (it's a searchpage). Now the page show
everything from an SQL server sorted on productnumber.
How can I let the users change the sorting of the documents without always
having to get the data again from the SQL server?

Thanks
Joris

May 6 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that...
0
by: Chris Mayers | last post by:
I have a Windows Forms DataGrid that has a DataView as a datasource. My problem is that I want the datagrid to exhibit some special sorting properties when the header rows are clicked on. From...
2
by: DelphiBlue | last post by:
I have a Nested Datagrid that is using a data relations to tie the parent child datagrids together. All is working well with the display but I am having some issues trying to sort the child...
1
by: Sargas Atum | last post by:
Hi all, 1. I have a problem with cell selection in a table in a DataGrid. I dont want that anybody writes in the cells. That was not a problem I changed them to "read only", but if I am going...
3
by: melanieab | last post by:
Hi, I'm programatically sorting in a datagrid. When a column header is clicked, the sort happens twice for some reason, making it looks like it only sorts in descending order. I can tell it...
1
by: Jeremy | last post by:
I want my gird to sort only the items on the current page when I click on a column header. I wrote a little test app, but when I sort it pulls in items from other pages and places them on the current...
5
by: DKC | last post by:
Hi, Using VB.NET. I have a datagrid having a strongly typed array of objects as its data source. The data from the array of objects is displayed by means of a table style, which is fine, but...
8
by: simchajoy2000 | last post by:
I thought the only thing I had to do to disable column sorting in VB.NET was to set datagrid.AllowSorting = False. Unfortunately this has never worked for me. I discovered another set of code...
0
by: rupalirane07 | last post by:
Both grids displays fine. But the problem is only parent datagrid sorting works fine but when i clik on child datagrid for sorting it gives me error: NullReferenceException error Any...
1
by: Ahmed Yasser | last post by:
Hi all, i have a problem with the datagridview sorting, the problem is a bit complicated so i hope i can describe in the following steps: 1. i have a datagridview with two columns...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.