Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Datagrid sorting in WebMatrix

Posted on 2006-03-29
6
Medium Priority
?
550 Views
Last Modified: 2012-06-21
I am using Web Matrix and had drag a datagrid to display the data based on the value entered in OrderID -TextField.

When user enter orderid in text box, the datagrid list out the selected item based on the OrderID..
But then I set the AllowSorting property for Datagrid... When display on the web, there is link on the datagrid header but it doesn't sort when I click that link on the header.
Why?
0
Comment
Question by:redcoder
  • 3
  • 3
6 Comments
 
LVL 8

Assisted Solution

by:mppeters
mppeters earned 1500 total points
ID: 16326981
Depending on how you fill the datagrid, you need to handle the datagird sort event. A data source control can do it for you. But a DataTable would need to be sorted using a DataView, then rebound to the grid.
0
 

Author Comment

by:redcoder
ID: 16327073
I don't quite understand... Could you give simple example ?
0
 
LVL 8

Accepted Solution

by:
mppeters earned 1500 total points
ID: 16327107
How do you fill the DataGrid? That will allow me to provide a better example.
Otherwise you can look at: http://aspnet.4guysfromrolla.com/articles/052202-1.aspx
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:redcoder
ID: 16327159
I am using the Select Data Method form the CODE panel in Web Matrix... Then choose the Table name and the Where condition... Finally select the DataSet and name the method as GetOrderDetails.

After that I bind the GetOrderDetails method with with :
Dim orderID as String
    orderID =TextBox2.Text
    DataGrid1.DataSource = GetOrderDetails(CInt(TextBox2.Text))
    DataGrid1.DataBind()

Then I set the property of Datagrid1 AllowSorting to TRUE

It is able to display the record but not able to sort when I click the link in the datagrid header
0
 

Author Comment

by:redcoder
ID: 16327269
I set the AutoGeneratedColumn to True..
0
 
LVL 8

Expert Comment

by:mppeters
ID: 16332179
Did you read the article I mentioned? It contains everything you need to sort. Be sure to read Part 2 of the article as it contains some of the info you need.
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Screencast - Getting to Know the Pipeline
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question