?
Solved

Enable sorting on DataGrid and some other stuff

Posted on 2006-06-26
2
Medium Priority
?
593 Views
Last Modified: 2008-01-09
How can I do the following in my DataGrid using VB.NET:

1) Enable sorting by ID, FirstName, LastName
2) Cache for 15 minutes
3) Display only 5 records at at ime


My code-behind (which is calling a method from my class to fill the dataset):


Imports System
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Public Class WebForm1
Inherits System.Web.UI.Page


Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim da As New TestShoppingCart.User
DataGrid1.DataSource = da.GetActiveUsers
DataGrid1.DataBind()
End Sub

Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged
End Sub

End Class
0
Comment
Question by:dba123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
justinbillig earned 1200 total points
ID: 16985607
read this article from 4guysfromrolla about the asp data grid

http://aspnet.4guysfromrolla.com/articles/040502-1.aspx

it is a long read but it is well worth it and you will be well versed in the datagrid.

0
 
LVL 26

Assisted Solution

by:Rejojohny
Rejojohny earned 800 total points
ID: 16989217
have a look at www.datagridgirl.com/articles.aspx for all kinds of examples on datagrid .. it contains many examples of sorting and paging datagrids which is what u require

as for caching for 15 minutes... use cache.insert .. and set the slidingexpiration property to 15 minutes .. i do not have MSDN on this machine and so cannot give u the exact syntax ..
0

Featured Post

Industry Leaders: 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!

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month8 days, 22 hours left to enroll

765 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